From: Heiko Carstens Date: Thu, 28 Dec 2006 12:05:36 +0000 (+0100) Subject: qeth: fix uaccess handling and get rid of unused variable X-Git-Tag: v2.6.20-rc5~34^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a6b95c81c522d9dbd36b33d33b08e66c87a6088;p=linux-2.6 qeth: fix uaccess handling and get rid of unused variable [patch] qeth: fix uaccess handling and get rid of unused variable drivers/s390/net/qeth_main.c: In function `qeth_process_inbound_buffer': drivers/s390/net/qeth_main.c:2563: warning: unused variable `vlan_addr' include/asm/uaccess.h: In function `qeth_do_ioctl': drivers/s390/net/qeth_main.c:4847: warning: ignoring return value of `copy_to_user' drivers/s390/net/qeth_main.c:4849: warning: ignoring return value of `copy_to_user' drivers/s390/net/qeth_main.c:4996: warning: ignoring return value of `copy_to_user' Cc: Frank Pavlic Signed-off-by: Heiko Carstens Signed-off-by: Jeff Garzik --- diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 2bde4f1fb9..f17d7cfb42 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -2560,7 +2560,6 @@ qeth_process_inbound_buffer(struct qeth_card *card, int offset; int rxrc; __u16 vlan_tag = 0; - __u16 *vlan_addr; /* get first element of current buffer */ element = (struct qdio_buffer_element *)&buf->buffer->element[0]; @@ -4844,9 +4843,11 @@ qeth_arp_query(struct qeth_card *card, char __user *udata) "(0x%x/%d)\n", QETH_CARD_IFNAME(card), qeth_arp_get_error_cause(&rc), tmp, tmp); - copy_to_user(udata, qinfo.udata, 4); + if (copy_to_user(udata, qinfo.udata, 4)) + rc = -EFAULT; } else { - copy_to_user(udata, qinfo.udata, qinfo.udata_len); + if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) + rc = -EFAULT; } kfree(qinfo.udata); return rc; @@ -4992,8 +4993,10 @@ qeth_snmp_command(struct qeth_card *card, char __user *udata) if (rc) PRINT_WARN("SNMP command failed on %s: (0x%x)\n", QETH_CARD_IFNAME(card), rc); - else - copy_to_user(udata, qinfo.udata, qinfo.udata_len); + else { + if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) + rc = -EFAULT; + } kfree(ureq); kfree(qinfo.udata);