summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-04-21 16:35:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-09 09:14:37 +0200
commit409789e2cec54cb06fb319250fc2be597a04cf42 (patch)
tree4bc8c0ea974ff6516fe4daba18f8c083cc15d786
parent45b7fca32bbccaac064eb57fa216e1ce5d61959c (diff)
downloadlinux-stable-409789e2cec54cb06fb319250fc2be597a04cf42.tar.gz
linux-stable-409789e2cec54cb06fb319250fc2be597a04cf42.tar.bz2
linux-stable-409789e2cec54cb06fb319250fc2be597a04cf42.zip
bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
[ Upstream commit fff8c10368e64e7f8960f149375c12ca5f3b30af ] This code is really spurious. It always returns an ERR_PTR, even when err is known to be 0 and calls put_device() after a successful device_register() call. It is likely that the return statement in the normal path is missing. Add 'return rdev;' to fix it. Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/bus/sunxi-rsb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index 4566e730ef2b..60b082fe2ed0 100644
--- a/drivers/bus/sunxi-rsb.c
+++ b/drivers/bus/sunxi-rsb.c
@@ -227,6 +227,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,
dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));
+ return rdev;
+
err_device_add:
put_device(&rdev->dev);