Messages in this thread | | | Subject | Re: BUG: unable to handle page fault for address = ADDR | From | Ben Hutchings <> | Date | Fri, 26 Apr 2019 12:36:07 +0100 |
| |
On Thu, 2019-04-25 at 16:13 -0700, Linus Torvalds wrote: [...] > so we do "slhc_free()" on an error pointer, which results in > > BUG: unable to handle page fault for address = fffffffffffffff4 > > and the fix might be something like the appended whitespace-damaged > trivial one-liner: just make slhc_free() silently ignore an error > pointer, to match the slhc_init() return behavior. > > Ben? David?
This looks sensible to me.
Ben.
> Linus > > diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c > index f4e93f5fc204..ea90db3c7705 100644 > --- a/drivers/net/slip/slhc.c > +++ b/drivers/net/slip/slhc.c > @@ -153,7 +153,7 @@ slhc_init(int rslots, int tslots) > void > slhc_free(struct slcompress *comp) > { > - if ( comp == NULLSLCOMPR ) > + if ( IS_ERR_OR_NULL(comp) ) > return; > > if ( comp->tstate != NULLSLSTATE ) -- Ben Hutchings It is impossible to make anything foolproof because fools are so ingenious.
[unhandled content-type:application/pgp-signature] | |