Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

From: Linus Torvalds
Date: Mon Nov 27 2017 - 18:31:58 EST


On Mon, Nov 27, 2017 at 3:25 PM, David Howells <dhowells@xxxxxxxxxx> wrote:
>
> This function has a list of requisite parameters for the caller:

.. and so what?

When you call "free()", that has a requisite parameter: the data to
free. If you don't supply it, we should BUG_ON(), right?

No. Instead we do the sane thing and just do

if (unlikely(ZERO_OR_NULL_PTR(x)))
return;

and it's all good.

> If you fail to obtain any one of these parameters, you can't use this function
> and you should have errored out before calling this function.

Again, what is the *advantage* of being a complete ass-wipe and saying
"f*ck you", when it's less code to just say "that didn't work"?

Because one of those BUG_ON's clearly did happen.

So exactly what is your excuse for killing the machine instead of just
saying "yeah, can't validate that"?

Linus