Skip to content

Commit

Permalink
[media] gspca: remove needless check before usb_free_coherent()
Browse files Browse the repository at this point in the history
usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Wei Yongjun authored and Mauro Carvalho Chehab committed Mar 23, 2013
1 parent a3ad56d commit 8b2c3da
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/media/usb/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)

gspca_dev->urb[i] = NULL;
usb_kill_urb(urb);
if (urb->transfer_buffer != NULL)
usb_free_coherent(gspca_dev->dev,
urb->transfer_buffer_length,
urb->transfer_buffer,
urb->transfer_dma);
usb_free_coherent(gspca_dev->dev,
urb->transfer_buffer_length,
urb->transfer_buffer,
urb->transfer_dma);
usb_free_urb(urb);
}
}
Expand Down

0 comments on commit 8b2c3da

Please sign in to comment.