drivers/isdn/i4l/* - compile warning
PATCH 6/21 drivers/isdn/i4l/* - compile warning
Description: compile warning cleanup - handle copy_to/from_user error returns, initialize return value to reasonable number in case used before initialized.
Signed-off-by Stephen Biggs <[email protected]>
drivers/isdn/i4l/isdn_common.c +5 -1
@@ -1842,8 +1842,12 @@ isdn_writebuf_stub(int drvidx, int chan,if (!skb)return 0 ;skb_reserve (skb, hl); -copy_from_user (skb_put (skb, len), buf, len); +if (copy_from_user (skb_put (skb, len), buf, len)) { + ret = -EFAULT ; + goto after_writebuf_skb; + } ret = dev->drv[drvidx]->interface->writebuf_skb (drvidx, chan,1 , skb); +after_writebuf_skb:if (ret <=0 )dev_kfree_skb (skb);if (ret >0 )
drivers/isdn/i4l/isdn_ppp.c +2 -1
@@ -789,7 +789,8 @@ isdn_ppp_read(int min, struct file *file is->first = b;spin_unlock_irqrestore (&is->buflock, flags); -copy_to_user (buf, save_buf, count); +if (copy_to_user (buf, save_buf, count)) + count = -EFAULT ;/* make sure we free the save_buf */ kfree (save_buf);return count;
drivers/isdn/i4l/isdn_v110.c +1 -1
@@ -520,7 +520,7 @@ isdn_v110_stat_callback(int idx, isdn_ct {isdn_v110_stream *v =NULL ;int i; -int ret; +int ret =0 ;if (idx <0 )return 0 ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors