rtc: optee: Fix a couple error codes
Subsystems (2)
cover rtc: optee: Fix a couple error codes
Fix a couple error codes detected by Smatch.
Dan Carpenter (2):
rtc: optee: fix error code in probe()
rtc: optee: Fix error code in optee_rtc_read_alarm()
drivers/rtc/rtc-optee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.51.0
PATCH 1/2 rtc: optee: fix error code in probe()
Return an error code if kthread_create() fails. Currently the code returns success.
--- drivers/rtc/rtc-optee.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-optee.c +1 -0
@@ -614,6 +614,7 @@ static int optee_rtc_probe(struct device *dev) priv, "rtc_alarm_evt");if (IS_ERR (priv->alarm_task)) {dev_err (dev,"Failed to create alarm thread\n" ); + err =PTR_ERR (priv->alarm_task); goto out_shm; }
Signature · 1 line
2.51.0
PATCH 2/2 rtc: optee: Fix error code in optee_rtc_read_alarm()
In reply to Dan CarpenterReturn "optee_alarm" instead of "alarm". The "alarm" pointer is a valid pointer and not an error pointer.
--- drivers/rtc/rtc-optee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-optee.c +1 -1
@@ -299,7 +299,7 @@ static int optee_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) optee_alarm =tee_shm_get_va (priv->shm,0 );if (IS_ERR (optee_alarm)) -return PTR_ERR (alarm); +return PTR_ERR (optee_alarm);if (param[0 ].u.memref.size !=sizeof (*optee_alarm))return -EPROTO ;
Signature · 1 line
2.51.0
Quoted 10 lines · Dan Carpenter
Fix a couple error codes detected by Smatch.
Dan Carpenter (2):
rtc: optee: fix error code inprobe()
rtc: optee: Fix error code inoptee_rtc_read_alarm()
drivers/rtc/rtc-optee.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)[...]
Applied, thanks!
[1/2] rtc: optee: fix error code in probe()
https://git.kernel.org/abelloni/c/8bbd727453b4 [2/2] rtc: optee: Fix error code in optee_rtc_read_alarm() https://git.kernel.org/abelloni/c/eb7392a01964
Best regards,
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com