Skip to content

Commit

Permalink
staging: go7007: Remove NULL check before kfree
Browse files Browse the repository at this point in the history
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ilia Mirkin authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent b009178 commit 56d1763
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/go7007/go7007-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,15 +1247,13 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
vurb = usb->video_urbs[i];
if (vurb) {
usb_kill_urb(vurb);
if (vurb->transfer_buffer)
kfree(vurb->transfer_buffer);
kfree(vurb->transfer_buffer);
usb_free_urb(vurb);
}
aurb = usb->audio_urbs[i];
if (aurb) {
usb_kill_urb(aurb);
if (aurb->transfer_buffer)
kfree(aurb->transfer_buffer);
kfree(aurb->transfer_buffer);
usb_free_urb(aurb);
}
}
Expand Down

0 comments on commit 56d1763

Please sign in to comment.