diff options
| -rw-r--r-- | fs/pstore/ram.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 076e26fdc0c0..898c8321b343 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
| @@ -710,18 +710,15 @@ static int ramoops_probe(struct platform_device *pdev) | |||
| 710 | { | 710 | { |
| 711 | struct device *dev = &pdev->dev; | 711 | struct device *dev = &pdev->dev; |
| 712 | struct ramoops_platform_data *pdata = dev->platform_data; | 712 | struct ramoops_platform_data *pdata = dev->platform_data; |
| 713 | struct ramoops_platform_data pdata_local; | ||
| 713 | struct ramoops_context *cxt = &oops_cxt; | 714 | struct ramoops_context *cxt = &oops_cxt; |
| 714 | size_t dump_mem_sz; | 715 | size_t dump_mem_sz; |
| 715 | phys_addr_t paddr; | 716 | phys_addr_t paddr; |
| 716 | int err = -EINVAL; | 717 | int err = -EINVAL; |
| 717 | 718 | ||
| 718 | if (dev_of_node(dev) && !pdata) { | 719 | if (dev_of_node(dev) && !pdata) { |
| 719 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 720 | pdata = &pdata_local; |
| 720 | if (!pdata) { | 721 | memset(pdata, 0, sizeof(*pdata)); |
| 721 | pr_err("cannot allocate platform data buffer\n"); | ||
| 722 | err = -ENOMEM; | ||
| 723 | goto fail_out; | ||
| 724 | } | ||
| 725 | 722 | ||
| 726 | err = ramoops_parse_dt(pdev, pdata); | 723 | err = ramoops_parse_dt(pdev, pdata); |
| 727 | if (err < 0) | 724 | if (err < 0) |
