Re: [PATCH v6 1/6] usb: Add support for Intel LJCA device
From: Andi Shyti
Date: Sun Mar 26 2023 - 11:02:36 EST
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