From: Dan Carpenter Date: Fri, 10 Dec 2010 02:40:09 +0000 (+0000) Subject: isdn: return -EFAULT if copy_from_user() fails X-Git-Tag: v3.12-rc1~7851^2~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36accaed22347f4b09cbc3c9fe2c1163a3575ea1;p=kernel%2Fkernel-generic.git isdn: return -EFAULT if copy_from_user() fails We should be returning -EFAULT here. Mostly this patch is to silence a smatch warning. The upper levels of this driver turn all non-zero return values from isar_load_firmware() into 1. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 1be4552..c9cd4d2 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -212,9 +212,9 @@ isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) cs->debug &= ~(L1_DEB_HSCX | L1_DEB_HSCX_FIFO); #endif - if ((ret = copy_from_user(&size, p, sizeof(int)))) { + if (copy_from_user(&size, p, sizeof(int))) { printk(KERN_ERR"isar_load_firmware copy_from_user ret %d\n", ret); - return ret; + return -EFAULT; } p += sizeof(int); printk(KERN_DEBUG"isar_load_firmware size: %d\n", size);