提交 6741448e 编写于 作者: T Thomas Pugliese 提交者: Greg Kroah-Hartman

usb: wusbcore: set pointers to NULL after freeing in error cases

This patch fixes two cases where error handling code was freeing memory
but not setting the pointer to NULL.  This could lead to a double free
in the HWA shutdown code.
Signed-off-by: NThomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d5b5c9f2
......@@ -1560,6 +1560,7 @@ static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer,
xfer, seg_idx, result);
seg->result = result;
kfree(wa->buf_in_urb->sg);
wa->buf_in_urb->sg = NULL;
error_sg_alloc:
__wa_xfer_abort(xfer);
error_complete:
......@@ -1859,6 +1860,7 @@ void wa_handle_notif_xfer(struct wahc *wa, struct wa_notif_hdr *notif_hdr)
error_dti_urb_submit:
usb_put_urb(wa->buf_in_urb);
wa->buf_in_urb = NULL;
error_buf_in_urb_alloc:
usb_put_urb(wa->dti_urb);
wa->dti_urb = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册