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

Andi Shyti
2023-03-26T15:02:34Z

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