Skip to content

Commit 8ad7868

Browse files
committed
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
2 parents d416a46 + d97038d commit 8ad7868

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/pstore/ram.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ static int ramoops_probe(struct platform_device *pdev)
875875
return err;
876876
}
877877

878-
static int ramoops_remove(struct platform_device *pdev)
878+
static void ramoops_remove(struct platform_device *pdev)
879879
{
880880
struct ramoops_context *cxt = &oops_cxt;
881881

@@ -885,8 +885,6 @@ static int ramoops_remove(struct platform_device *pdev)
885885
cxt->pstore.bufsize = 0;
886886

887887
ramoops_free_przs(cxt);
888-
889-
return 0;
890888
}
891889

892890
static const struct of_device_id dt_match[] = {
@@ -896,7 +894,7 @@ static const struct of_device_id dt_match[] = {
896894

897895
static struct platform_driver ramoops_driver = {
898896
.probe = ramoops_probe,
899-
.remove = ramoops_remove,
897+
.remove_new = ramoops_remove,
900898
.driver = {
901899
.name = "ramoops",
902900
.of_match_table = dt_match,

fs/pstore/ram_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
599599
raw_spin_lock_init(&prz->buffer_lock);
600600
prz->flags = flags;
601601
prz->label = kstrdup(label, GFP_KERNEL);
602+
if (!prz->label)
603+
goto err;
602604

603605
ret = persistent_ram_buffer_map(start, size, prz, memtype);
604606
if (ret)

0 commit comments

Comments
 (0)