Re: BUG: unable to handle page fault for address = ADDR

From: Ben Hutchings
Date: Fri Apr 26 2019 - 07:36:24 EST


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.

Attachment: signature.asc
Description: This is a digitally signed message part