mirror of https://gitee.com/openkylin/linux.git
brcmfmac: kill URB when request timed out
Kill the submitted URB in brcmf_usb_dl_cmd if the request timed out. This assures the URB is never submitted twice. It also prevents a possible use-after-free of the URB transfer buffer if a timeout occurs. Signed-off-by: Mathy Vanhoef <vanhoefm@gmail.com> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
daad166028
commit
8180bd47b0
|
@ -669,10 +669,12 @@ static int brcmf_usb_dl_cmd(struct brcmf_usbdev_info *devinfo, u8 cmd,
|
|||
goto finalize;
|
||||
}
|
||||
|
||||
if (!brcmf_usb_ioctl_resp_wait(devinfo))
|
||||
if (!brcmf_usb_ioctl_resp_wait(devinfo)) {
|
||||
usb_kill_urb(devinfo->ctl_urb);
|
||||
ret = -ETIMEDOUT;
|
||||
else
|
||||
} else {
|
||||
memcpy(buffer, tmpbuf, buflen);
|
||||
}
|
||||
|
||||
finalize:
|
||||
kfree(tmpbuf);
|
||||
|
|
Loading…
Reference in New Issue