Skip to content

Commit 925e277

Browse files
Wolfram Sangdavem330
authored andcommitted
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@pengutronix.de> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 18a31e1 commit 925e277

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎net/irda/irttp.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ EXPORT_SYMBOL(irttp_close_tsap);
550550
*/
551551
int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
552552
{
553-
int ret = -1;
553+
int ret;
554554

555555
IRDA_ASSERT(self != NULL, return -1;);
556556
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)
566566

567567
/* Check that nothing bad happens */
568568
if (!self->connected) {
569-
IRDA_DEBUG(1, "%s(), Not connected\n", __func__);
569+
IRDA_WARNING("%s(), Not connected\n", __func__);
570+
ret = -ENOTCONN;
570571
goto err;
571572
}
572573

573574
if (skb->len > self->max_seg_size) {
574-
IRDA_DEBUG(1, "%s(), UData is too large for IrLAP!\n",
575-
__func__);
575+
IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__);
576+
ret = -EMSGSIZE;
576577
goto err;
577578
}
578579

0 commit comments

Comments
 (0)