lkml.org 
[lkml]   [2021]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] applicom: fix some err codes returned by ac_ioctl
Date
When cmd > 6 or copy_to_user() fail, The variable 'ret' would not be 
returned back. Fix the 'ret' set but not used.

Signed-off-by: Xu Jia <xujia39@huawei.com>
---
drivers/char/applicom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 14b2d8034c51..0ab765143354 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -839,7 +839,7 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
Dummy = readb(apbs[IndexCard].RamIO + VERS);
kfree(adgl);
mutex_unlock(&ac_mutex);
- return 0;
+ return ret;

err:
if (warncount) {
--
2.25.1
\
 
 \ /
  Last update: 2021-03-24 08:08    [W:1.112 / U:1.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site