Re: [PATCH] staging: r8188eu: fix NULL check for rcu pointer

From: Martin Kaiser
Date: Tue Jan 31 2023 - 12:23:47 EST


Hello Dan and all,

Thus wrote Dan Carpenter (error27@xxxxxxxxx):

> This patch is fine but it's a clean up and not a fix. The original code
> doesn't dereference "br_port". I guess the new code is faster and
> especially if you have lockdep enabled, so maybe in that sense it is a
> fix.

ok, I see. The br_port pointer may no longer be valid after rcu_unlock
but we can still check it for NULL at that time without dereferencing it.

Thanks for the clarification,
Martin