applicom: fix some err codes returned by ac_ioctl
PATCH 1/1 applicom: fix some err codes returned by ac_ioctl
When cmd > 6 or copy_to_user() fail, The variable 'ret' would not be returned back. Fix the 'ret' set but not used.
--- drivers/char/applicom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/applicom.c +1 -1
@@ -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) {
Signature · 1 line
2.25.1
Quoted 5 lines · Xu Jia
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 <[email protected]>
drivers/char/applicom.c static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 843
Quoted 11 lines
drivers/char/applicom.c +1
-1@@ -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;
Apparently this has been broken since the driver was first merged in linux-2.3.16. I could find no indication of anyone using the driver and reporting any problems in the git history and it clearly still has the style of drivers writting in the 1990s. On the other hand, this is (was) used in some very long-lived systems and you can still buy old applicom cards from artisan[1].
Is there any chance this driver is still used anywhere with modern kernels? I suspect we could move it to staging to find out.
Arnd
gregkh
maintainerQuoted 28 lines · Arnd Bergmann
Quoted 5 lines · Xu Jia
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 <[email protected]>Reviewed-by Arnd Bergmann <[email protected]>drivers/char/applicom.c static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 843
Quoted 11 lines
drivers/char/applicom.c +1
-1@@ -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;Apparently this has been broken since the driver was first merged in linux-2.3.16. I could find no indication of anyone using the driver and reporting any problems in the git history and it clearly still has the style of drivers writting in the 1990s. On the other hand, this is (was) used in some very long-lived systems and you can still buy old applicom cards from artisan[1].
Quoted 2 lines
Is there any chance this driver is still used anywhere with modern kernels? I suspect we could move it to staging to find out.
No objection from me to move it to staging, want to send a patch or I can.
thanks,
greg k-h