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 <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2010-12-10 02:40:09 +00:00 коммит произвёл David S. Miller
Родитель 5d52040d4d
Коммит 36accaed22
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -212,9 +212,9 @@ isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf)
cs->debug &= ~(L1_DEB_HSCX | L1_DEB_HSCX_FIFO); cs->debug &= ~(L1_DEB_HSCX | L1_DEB_HSCX_FIFO);
#endif #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); printk(KERN_ERR"isar_load_firmware copy_from_user ret %d\n", ret);
return ret; return -EFAULT;
} }
p += sizeof(int); p += sizeof(int);
printk(KERN_DEBUG"isar_load_firmware size: %d\n", size); printk(KERN_DEBUG"isar_load_firmware size: %d\n", size);