Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81837
b: refs/heads/master
c: 9ff5587
h: refs/heads/master
i:
  81835: 343cb9e
v: v3
  • Loading branch information
Jussi Kivilinna authored and David S. Miller committed Feb 1, 2008
1 parent dabd1ff commit ff10030
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04c3c01a21a098140678ab9369cc0487775b8df6
refs/heads/master: 9ff55874fea71f483581f48990658d3929adb034
12 changes: 9 additions & 3 deletions trunk/drivers/net/usb/rndis_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
struct rndis_query_c *get_c;
struct rndis_set *set;
struct rndis_set_c *set_c;
struct rndis_halt *halt;
} u;
u32 tmp;
int reply_len;
Expand Down Expand Up @@ -517,7 +518,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
goto fail_and_release;
goto halt_fail_and_release;
}
dev->hard_mtu = tmp;
net->mtu = dev->hard_mtu - net->hard_header_len;
Expand All @@ -539,7 +540,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
48, (void **) &bp, &reply_len);
if (unlikely(retval< 0)) {
dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval);
goto fail_and_release;
goto halt_fail_and_release;
}
memcpy(net->dev_addr, bp, ETH_ALEN);

Expand All @@ -555,14 +556,19 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
retval = rndis_command(dev, u.header);
if (unlikely(retval < 0)) {
dev_err(&intf->dev, "rndis set packet filter, %d\n", retval);
goto fail_and_release;
goto halt_fail_and_release;
}

retval = 0;

kfree(u.buf);
return retval;

halt_fail_and_release:
memset(u.halt, 0, sizeof *u.halt);
u.halt->msg_type = RNDIS_MSG_HALT;
u.halt->msg_len = ccpu2(sizeof *u.halt);
(void) rndis_command(dev, (void *)u.halt);
fail_and_release:
usb_set_intfdata(info->data, NULL);
usb_driver_release_interface(driver_of(intf), info->data);
Expand Down

0 comments on commit ff10030

Please sign in to comment.