Subject: Re: [patch] hamradio: avoid null deref v2

From: David Miller <[email-masked]>
Date: Sat, 26 Dec 2009 20:17:29 -0800 (PST)

From: Dan Carpenter <[email-masked]>
Date: Sat, 26 Dec 2009 14:38:12 +0200

> Bump the stats on the original dev not on the newly assigned NULL version of
> dev.
> 
> Signed-off-by: Dan Carpenter <[email-masked]>

This doesn't look real nice.

The bpq_get_ether_dev() abstraction exists so that the details of
bpq->this and bpq->that are hidden behind it.

Exposing those details inline just to fix this bug makes the
abstraction significantly less useful, and the code more ugly.

Please just create an "orig_dev" pointer to save the original device
in, and use it to fix this problem properly.

That way you only fetch the bpq ether device pointer via the
abstraction interface.

And BTW, this is how other reviewers told you to implement this
fix. :-)

Thanks.