Re: [PATCH] net: usbnet: Fix potential NULL pointer dereference

From: Ren Mingshuai
Date: Thu Nov 02 2023 - 05:25:34 EST


>> >23ba07991dad said SKB can be NULL without describing the triggering
>> >scenario. Always Check it before dereference to void potential NULL
>> >pointer dereference.
>> I've tried to find out the scenarios where SKB is NULL, but failed.
>> It seems impossible for SKB to be NULL. If SKB can be NULL, please
>> tell me the reason and I'd be very grateful.
>
>What do you mean? Grepping the function name shows call sites with NULL getting passed as skb.

Yes And I just learned that during the cdc_ncm_driver.probe, it is possible to pass a NULL SKB to usbnet_start_xmit().