From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751148AbdJBN0Z (ORCPT ); Mon, 2 Oct 2017 09:26:25 -0400 Received: from esa7.dell-outbound.iphmx.com ([68.232.153.96]:58567 "EHLO esa7.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbdJBN0Y (ORCPT ); Mon, 2 Oct 2017 09:26:24 -0400 From: X-LoopCount0: from 10.166.132.190 X-IronPort-AV: E=Sophos;i="5.42,469,1500958800"; d="scan'208";a="992548958" X-DLP: DLP_GlobalPCIDSS To: CC: , , , , , Subject: RE: [PATCH v3 8/8] platform/x86: dell-wmi-smbios: clean up wmi descriptor check Thread-Topic: [PATCH v3 8/8] platform/x86: dell-wmi-smbios: clean up wmi descriptor check Thread-Index: AQHTO4FGbLkCuq5jiUOc+cQSDAbQ8aLQjPig Date: Mon, 2 Oct 2017 13:26:21 +0000 Message-ID: References: <84b6170a1d3a692b53a40f795dd4f9a3052b8fe3.1506571188.git.mario.limonciello@dell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.18.86] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v92DQWL3018534 > -----Original Message----- > From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com] > Sent: Monday, October 2, 2017 8:16 AM > To: Limonciello, Mario > Cc: dvhart@infradead.org; LKML ; Platform Driver > ; Andy Lutomirski ; > quasisec@google.com; Pali Rohár > Subject: Re: [PATCH v3 8/8] platform/x86: dell-wmi-smbios: clean up wmi > descriptor check > > On Thu, Sep 28, 2017 at 7:02 AM, Mario Limonciello > 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 > > Reviewed-by: Edward O'Callaghan > > Btw, missed Suggested-by? Yes sorry about that. I'll add that for when I get v4 out. > > > > - 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