Re: [RESEND] qed: Move a variable assignment behind a null pointer check in two functions
From: Dan Carpenter
Date: Mon Mar 03 2025 - 03:31:43 EST
On Mon, Mar 03, 2025 at 09:22:58AM +0100, Markus Elfring wrote:
> > The assignment:
> >
> > p_rx = &p_ll2_conn->rx_queue;
> >
> > does not dereference "p_ll2_conn". It just does pointer math. So the
> > original code works fine.
>
> Is there a need to clarify affected implementation details any more?
> https://wiki.sei.cmu.edu/confluence/display/c/EXP34-C.+Do+not+dereference+null+pointers
This is not a NULL dereference. It's just pointer math.
regards,
dan carpenter