lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 16 Nov 2010 20:40:02 +0100 From: Wolfram Sang <w.sang@...gutronix.de> To: netdev@...r.kernel.org Cc: Wolfram Sang <w.sang@...gutronix.de>, Samuel Ortiz <sameo@...ux.intel.com>, David Miller <davem@...emloft.net> Subject: [PATCH] net: irda: irttp: sync error paths of data- and udata-requests irttp_data_request() returns meaningful errorcodes, while irttp_udata_request() just returns -1 in similar situations. Sync the two and the loglevels of the accompanying output. Signed-off-by: Wolfram Sang <w.sang@...gutronix.de> Cc: Samuel Ortiz <sameo@...ux.intel.com> Cc: David Miller <davem@...emloft.net> --- Thank you David for picking up the zero-byte-packet-patch. Now as it was applied, this one might be interesting, too (on top of it)? Nothing seriously needed, but looks more proper IMHO. LXR says that are callers of these functions check with < 0 anyhow. net/irda/irttp.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 6cfaeaf..f6054f9 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -550,7 +550,7 @@ EXPORT_SYMBOL(irttp_close_tsap); */ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) { - int ret = -1; + int ret; IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); @@ -566,13 +566,14 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) /* Check that nothing bad happens */ if (!self->connected) { - IRDA_DEBUG(1, "%s(), Not connected\n", __func__); + IRDA_WARNING("%s(), Not connected\n", __func__); + ret = -ENOTCONN; goto err; } if (skb->len > self->max_seg_size) { - IRDA_DEBUG(1, "%s(), UData is too large for IrLAP!\n", - __func__); + IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__); + ret = -EMSGSIZE; goto err; } -- 1.7.2.3 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists