Skip to content

Commit fff8c10

Browse files
tititiou36jernejsk
authored andcommitted
bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
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: d787dcd ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Samuel Holland <[email protected]> Tested-by: Samuel Holland <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr
1 parent 3123109 commit fff8c10

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/bus/sunxi-rsb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,
227227

228228
dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));
229229

230+
return rdev;
231+
230232
err_device_add:
231233
put_device(&rdev->dev);
232234

0 commit comments

Comments
 (0)