Re: [PATCH v6 1/6] usb: Add support for Intel LJCA device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ye,

> +static void ljca_read_complete(struct urb *urb)
> +{
> +	struct ljca_msg *header = urb->transfer_buffer;
> +	struct ljca_dev *dev = urb->context;
> +	int len = urb->actual_length;
> +	int ret;
> +
> +	WARN_ON_ONCE(!dev);
> +	WARN_ON_ONCE(!header);

WARN_* macros should be used when we can recover from that
condition, while we are running straight to a NULL pointer
dereference.

If !dev or !header is not a warning but a "bug", so either you
make sure we don't go ahead or remove the check.

The rest looks fairly good,
Andi



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux