Skip to content

Commit

Permalink
net: irda: irttp: sync error paths of data- and udata-requests
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: David Miller <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wolfram Sang authored and davem330 committed Nov 18, 2010
1 parent 18a31e1 commit 925e277
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/irda/irttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;);
Expand All @@ -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;
}

Expand Down

0 comments on commit 925e277

Please sign in to comment.