patch "gnss: sirf: fix error return code in sirf_probe()" added to char-misc-next
Subsystems (2)
This is a note to let you know that I've just added the patch titled
gnss: sirf: fix error return code in sirf_probe()
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-next branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
From 43d7ce70ae43dd8523754b17f567417e0e75dbce Mon Sep 17 00:00:00 2001
From: Wei Yongjun <[email protected]>
Date: Thu, 7 May 2020 09:42:52 +0000
Subject: gnss: sirf: fix error return code in sirf_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
This avoids a use-after-free in case the driver is later unbound.
--- drivers/gnss/sirf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gnss/sirf.c +6 -2
@@ -439,14 +439,18 @@ static int sirf_probe(struct serdev_device *serdev) data->on_off =devm_gpiod_get_optional (dev,"sirf,onoff" ,GPIOD_OUT_LOW ); -if (IS_ERR (data->on_off)) +if (IS_ERR (data->on_off)) { + ret =PTR_ERR (data->on_off); goto err_put_device; + }if (data->on_off) { data->wakeup =devm_gpiod_get_optional (dev,"sirf,wakeup" ,GPIOD_IN ); -if (IS_ERR (data->wakeup)) +if (IS_ERR (data->wakeup)) { + ret =PTR_ERR (data->wakeup); goto err_put_device; + } ret =regulator_enable (data->vcc);if (ret)
Signature · 1 line
2.26.2