diff options
Diffstat (limited to 'net/econet/af_econet.c')
-rw-r--r-- | net/econet/af_econet.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 9938e76a8ff6..9cae16b4e0b7 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -336,6 +336,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
336 | /* Real hardware Econet. We're not worthy etc. */ | 336 | /* Real hardware Econet. We're not worthy etc. */ |
337 | #ifdef CONFIG_ECONET_NATIVE | 337 | #ifdef CONFIG_ECONET_NATIVE |
338 | unsigned short proto = 0; | 338 | unsigned short proto = 0; |
339 | int res; | ||
339 | 340 | ||
340 | dev_hold(dev); | 341 | dev_hold(dev); |
341 | 342 | ||
@@ -354,12 +355,12 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
354 | eb->sec = *saddr; | 355 | eb->sec = *saddr; |
355 | eb->sent = ec_tx_done; | 356 | eb->sent = ec_tx_done; |
356 | 357 | ||
357 | if (dev->hard_header) { | 358 | err = -EINVAL; |
358 | int res; | 359 | res = dev_hard_header(skb, dev, ntohs(proto), &addr, NULL, len); |
360 | if (res < 0) | ||
361 | goto out_free; | ||
362 | if (res > 0) { | ||
359 | struct ec_framehdr *fh; | 363 | struct ec_framehdr *fh; |
360 | err = -EINVAL; | ||
361 | res = dev->hard_header(skb, dev, ntohs(proto), | ||
362 | &addr, NULL, len); | ||
363 | /* Poke in our control byte and | 364 | /* Poke in our control byte and |
364 | port number. Hack, hack. */ | 365 | port number. Hack, hack. */ |
365 | fh = (struct ec_framehdr *)(skb->data); | 366 | fh = (struct ec_framehdr *)(skb->data); |
@@ -368,8 +369,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
368 | if (sock->type != SOCK_DGRAM) { | 369 | if (sock->type != SOCK_DGRAM) { |
369 | skb_reset_tail_pointer(skb); | 370 | skb_reset_tail_pointer(skb); |
370 | skb->len = 0; | 371 | skb->len = 0; |
371 | } else if (res < 0) | 372 | } |
372 | goto out_free; | ||
373 | } | 373 | } |
374 | 374 | ||
375 | /* Copy the data. Returns -EFAULT on error */ | 375 | /* Copy the data. Returns -EFAULT on error */ |