]> git.hungrycats.org Git - linux/commit
[PATCH] USB: Allow NULL argument in usb_unlink_urb() and usb_kill_urb()
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 14 Jul 2004 07:48:19 +0000 (00:48 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 14 Jul 2004 07:48:19 +0000 (00:48 -0700)
commit67cca2e61234fa193d6fc2f2036964ad9775ac6c
tree90dedb1221baf738987edfbbb81b9004685ba189
parentb6157a969d43cf929af9cb4aaf283db9519e4c8c
[PATCH] USB: Allow NULL argument in usb_unlink_urb() and usb_kill_urb()

It makes sense for APIs involved in cleanup activities (like kfree()) to
accept NULL arguments.  Doing so frees drivers from the responsibility of
checking whether each resource was actually acquired before trying to
release it.  Accordingly, this patch makes usb_unlink_urb() and
usb_kill_urb() accept a NULL pointer (which used to be acceptable until I
changed it) and notes explicitly in the kerneldoc that such arguments are
permitted.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/usb/core/urb.c