Re: [PATCH v3 8/8] platform/x86: dell-wmi-smbios: clean up wmi descriptor check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 28, 2017 at 7:02 AM, Mario Limonciello
<mario.limonciello@xxxxxxxx> wrote:
> Some cases the wrong type was used for errors and checks can be
> done more cleanly.

Oops, I forgot about this patch, so, please, disregard my comment WRT
to strncmp() use to the other patch.


> Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxxx>
> Reviewed-by: Edward O'Callaghan <quasisec@xxxxxxxxxx>

Btw, missed Suggested-by?


> -       if (desc_buffer[0] != 0x4C4C4544 && desc_buffer[1] != 0x494D5720)
> -               dev_warn(&wdev->dev, "Dell descriptor buffer has invalid signature (%*ph)\n",
> -                       8, desc_buffer);
> +       if (strncmp(obj->string.pointer, "DELL WMI", 8) != 0)
> +               dev_warn(&wdev->dev, "Dell descriptor buffer has invalid signature (%8ph)\n",
> +                       desc_buffer);

And as Darren pointed out, this fixes the logic bug as well.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux