> From: Greg KH [mailto:greg@kroah.com]
>
> +int usb_init_urb(struct urb *urb)
> +{
> + if (!urb)
> + return -EINVAL;
> ...
> ...
> ...
> @@ -38,13 +61,14 @@
> mem_flags);
> if (!urb) {
> err("alloc_urb: kmalloc failed");
> - return NULL;
> + goto exit;
> + }
> + if (usb_init_urb(urb)) {
> + kfree(urb);
> + urb = NULL;
> }
If usb_init_urb() is already testing for !urb, why
test it again? No doubt the compiler will probably
catch it if inlining ... but I think the best is
for usb_init_urb() to assume that urb is not NULL.
Let the caller make that sure.
Sorry if this is a dup ... I am catching up with
my mail ...
Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed May 07 2003 - 22:00:29 EST