Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore fixes from Kees Cook:

- Fix console ramoops to show the previous boot logs (Sai Prakash
Ranjan)

- Avoid allocation and leak of platform data

* tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
pstore/ram: Avoid allocation and leak of platform data
pstore/ram: Fix console ramoops to show the previous boot logs

+4 -8
+4 -8
fs/pstore/ram.c
··· 128 128 struct pstore_record *record) 129 129 { 130 130 struct persistent_ram_zone *prz; 131 - bool update = (record->type == PSTORE_TYPE_DMESG); 132 131 133 132 /* Give up if we never existed or have hit the end. */ 134 133 if (!przs) ··· 138 139 return NULL; 139 140 140 141 /* Update old/shadowed buffer. */ 141 - if (update) 142 + if (prz->type == PSTORE_TYPE_DMESG) 142 143 persistent_ram_save_old(prz); 143 144 144 145 if (!persistent_ram_old_size(prz)) ··· 710 711 { 711 712 struct device *dev = &pdev->dev; 712 713 struct ramoops_platform_data *pdata = dev->platform_data; 714 + struct ramoops_platform_data pdata_local; 713 715 struct ramoops_context *cxt = &oops_cxt; 714 716 size_t dump_mem_sz; 715 717 phys_addr_t paddr; 716 718 int err = -EINVAL; 717 719 718 720 if (dev_of_node(dev) && !pdata) { 719 - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 720 - if (!pdata) { 721 - pr_err("cannot allocate platform data buffer\n"); 722 - err = -ENOMEM; 723 - goto fail_out; 724 - } 721 + pdata = &pdata_local; 722 + memset(pdata, 0, sizeof(*pdata)); 725 723 726 724 err = ramoops_parse_dt(pdev, pdata); 727 725 if (err < 0)