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 SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux