diff options
Diffstat (limited to 'fs/pstore/ram.c')
| -rw-r--r-- | fs/pstore/ram.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 96f7d32cd184..898c8321b343 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
| @@ -128,7 +128,6 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], int id, | |||
| 128 | struct pstore_record *record) | 128 | struct pstore_record *record) |
| 129 | { | 129 | { |
| 130 | struct persistent_ram_zone *prz; | 130 | struct persistent_ram_zone *prz; |
| 131 | bool update = (record->type == PSTORE_TYPE_DMESG); | ||
| 132 | 131 | ||
| 133 | /* Give up if we never existed or have hit the end. */ | 132 | /* Give up if we never existed or have hit the end. */ |
| 134 | if (!przs) | 133 | if (!przs) |
| @@ -139,7 +138,7 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], int id, | |||
| 139 | return NULL; | 138 | return NULL; |
| 140 | 139 | ||
| 141 | /* Update old/shadowed buffer. */ | 140 | /* Update old/shadowed buffer. */ |
| 142 | if (update) | 141 | if (prz->type == PSTORE_TYPE_DMESG) |
| 143 | persistent_ram_save_old(prz); | 142 | persistent_ram_save_old(prz); |
| 144 | 143 | ||
| 145 | if (!persistent_ram_old_size(prz)) | 144 | if (!persistent_ram_old_size(prz)) |
| @@ -711,18 +710,15 @@ static int ramoops_probe(struct platform_device *pdev) | |||
| 711 | { | 710 | { |
| 712 | struct device *dev = &pdev->dev; | 711 | struct device *dev = &pdev->dev; |
| 713 | struct ramoops_platform_data *pdata = dev->platform_data; | 712 | struct ramoops_platform_data *pdata = dev->platform_data; |
| 713 | struct ramoops_platform_data pdata_local; | ||
| 714 | struct ramoops_context *cxt = &oops_cxt; | 714 | struct ramoops_context *cxt = &oops_cxt; |
| 715 | size_t dump_mem_sz; | 715 | size_t dump_mem_sz; |
| 716 | phys_addr_t paddr; | 716 | phys_addr_t paddr; |
| 717 | int err = -EINVAL; | 717 | int err = -EINVAL; |
| 718 | 718 | ||
| 719 | if (dev_of_node(dev) && !pdata) { | 719 | if (dev_of_node(dev) && !pdata) { |
| 720 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 720 | pdata = &pdata_local; |
| 721 | if (!pdata) { | 721 | memset(pdata, 0, sizeof(*pdata)); |
| 722 | pr_err("cannot allocate platform data buffer\n"); | ||
| 723 | err = -ENOMEM; | ||
| 724 | goto fail_out; | ||
| 725 | } | ||
| 726 | 722 | ||
| 727 | err = ramoops_parse_dt(pdev, pdata); | 723 | err = ramoops_parse_dt(pdev, pdata); |
| 728 | if (err < 0) | 724 | if (err < 0) |
