Prev: [PATCH] char: ip2: check put_user() result
Next: [PATCH] char: cs5535_gpio: check put_user() result
From: Kulikov Vasiliy on 29 Jul 2010 12:00 put_user() may fail, if so return -EFAULT. Signed-off-by: Kulikov Vasiliy <segooon(a)gmail.com> --- drivers/scsi/ch.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 4799d43..978bf68 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -548,7 +548,10 @@ static int ch_gstatus(scsi_changer *ch, int type, unsigned char __user *dest) retval = -EIO; break; } - put_user(data[2], dest+i); + if (put_user(data[2], dest+i)) { + retval = -EFAULT; + break; + } if (data[2] & CESTATUS_EXCEPT) vprintk("element 0x%x: asc=0x%x, ascq=0x%x\n", ch->firsts[type]+i, -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: [PATCH] char: ip2: check put_user() result Next: [PATCH] char: cs5535_gpio: check put_user() result |