Re: [PATCH 1/1] Preventive patch in the pin control subsystem to handle NULL check.

From: Linus Walleij
Date: Thu Aug 30 2018 - 05:03:38 EST


Hi Srikanth, thanks for your patch!

On Mon, Aug 27, 2018 at 10:39 AM Srikanth K H <srikanth.h@xxxxxxxxxxx> wrote:

@@ -269,8 +269,9 @@ void pinconf_show_setting(struct seq_file *s,

> desc = pin_desc_get(setting->pctldev,
> setting->data.configs.group_or_pin);
> - seq_printf(s, "pin %s (%d)", desc->name,
> - setting->data.configs.group_or_pin);
> + if (desc)
> + seq_printf(s, "pin %s (%d)", desc->name,
> + setting->data.configs.group_or_pin);

Under what circumstances do you expect this to happen?
Did you provoke it with a real usecase during development?

We do not sprinkle NULL or error handling over code that
will not derail, and since this is in debugfs we are even more
lax.

If it annoys users (which would then be developers using
debugfs during development), then we need to look into it.

Yours,
Linus Walleij