Patch "pstore/ram: Fix error return code in ramoops_probe()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    pstore/ram: Fix error return code in ramoops_probe()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pstore-ram-fix-error-return-code-in-ramoops_probe.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f1eddf0db34eb1e251eff8614c36ef7d2830bc4b
Author: Wang Yufen <wangyufen@xxxxxxxxxx>
Date:   Fri Dec 2 16:22:54 2022 +0800

    pstore/ram: Fix error return code in ramoops_probe()
    
    [ Upstream commit e1fce564900f8734edf15b87f028c57e14f6e28d ]
    
    In the if (dev_of_node(dev) && !pdata) path, the "err" may be assigned a
    value of 0, so the error return code -EINVAL may be incorrectly set
    to 0. To fix set valid return code before calling to goto.
    
    Fixes: 35da60941e44 ("pstore/ram: add Device Tree bindings")
    Signed-off-by: Wang Yufen <wangyufen@xxxxxxxxxx>
    Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1669969374-46582-1-git-send-email-wangyufen@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index bafbab2dd039..33294dee7d7f 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -753,6 +753,7 @@ static int ramoops_probe(struct platform_device *pdev)
 	/* Make sure we didn't get bogus platform data pointer. */
 	if (!pdata) {
 		pr_err("NULL platform data\n");
+		err = -EINVAL;
 		goto fail_out;
 	}
 
@@ -760,6 +761,7 @@ static int ramoops_probe(struct platform_device *pdev)
 			!pdata->ftrace_size && !pdata->pmsg_size)) {
 		pr_err("The memory size and the record/console size must be "
 			"non-zero\n");
+		err = -EINVAL;
 		goto fail_out;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux