Commit 8ad78685 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore updates from Kees Cook:

 - Check for out-of-memory condition (Jiasheng Jiang)

 - Convert to platform remove callback returning void (Uwe Kleine-König)

* tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/ram: Add check for kstrdup
  pstore/ram: Convert to platform remove callback returning void
parents d416a46c d97038d5
...@@ -875,7 +875,7 @@ static int ramoops_probe(struct platform_device *pdev) ...@@ -875,7 +875,7 @@ static int ramoops_probe(struct platform_device *pdev)
return err; return err;
} }
static int ramoops_remove(struct platform_device *pdev) static void ramoops_remove(struct platform_device *pdev)
{ {
struct ramoops_context *cxt = &oops_cxt; struct ramoops_context *cxt = &oops_cxt;
...@@ -885,8 +885,6 @@ static int ramoops_remove(struct platform_device *pdev) ...@@ -885,8 +885,6 @@ static int ramoops_remove(struct platform_device *pdev)
cxt->pstore.bufsize = 0; cxt->pstore.bufsize = 0;
ramoops_free_przs(cxt); ramoops_free_przs(cxt);
return 0;
} }
static const struct of_device_id dt_match[] = { static const struct of_device_id dt_match[] = {
...@@ -896,7 +894,7 @@ static const struct of_device_id dt_match[] = { ...@@ -896,7 +894,7 @@ static const struct of_device_id dt_match[] = {
static struct platform_driver ramoops_driver = { static struct platform_driver ramoops_driver = {
.probe = ramoops_probe, .probe = ramoops_probe,
.remove = ramoops_remove, .remove_new = ramoops_remove,
.driver = { .driver = {
.name = "ramoops", .name = "ramoops",
.of_match_table = dt_match, .of_match_table = dt_match,
......
...@@ -599,6 +599,8 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, ...@@ -599,6 +599,8 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
raw_spin_lock_init(&prz->buffer_lock); raw_spin_lock_init(&prz->buffer_lock);
prz->flags = flags; prz->flags = flags;
prz->label = kstrdup(label, GFP_KERNEL); prz->label = kstrdup(label, GFP_KERNEL);
if (!prz->label)
goto err;
ret = persistent_ram_buffer_map(start, size, prz, memtype); ret = persistent_ram_buffer_map(start, size, prz, memtype);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment