From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23FF1C48BE4 for ; Thu, 20 Jun 2019 12:54:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1F3B2080D for ; Thu, 20 Jun 2019 12:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731827AbfFTMyl (ORCPT ); Thu, 20 Jun 2019 08:54:41 -0400 Received: from mga02.intel.com ([134.134.136.20]:32429 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbfFTMyl (ORCPT ); Thu, 20 Jun 2019 08:54:41 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2019 05:54:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,396,1557212400"; d="scan'208";a="165309292" Received: from mylly.fi.intel.com (HELO [10.237.72.61]) ([10.237.72.61]) by orsmga006.jf.intel.com with ESMTP; 20 Jun 2019 05:54:38 -0700 Subject: Re: [PATCH] spi/acpi: avoid spurious matches during slave enumeration To: Ard Biesheuvel , linux-spi@vger.kernel.org Cc: broonie@kernel.org, Mika Westerberg , andy.shevchenko@gmail.com, masahisa.kojima@linaro.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Lukas Wunner References: <20190620123649.4492-1-ard.biesheuvel@linaro.org> From: Jarkko Nikula Message-ID: Date: Thu, 20 Jun 2019 15:54:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190620123649.4492-1-ard.biesheuvel@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 6/20/19 3:36 PM, Ard Biesheuvel wrote: > In the new SPI ACPI slave enumeration code, we use the value of > lookup.max_speed_khz as a flag to decide whether a match occurred. > However, doing so only makes sense if we initialize its value to > zero beforehand, or otherwise, random junk from the stack will > cause spurious matches. > > So zero initialize the lookup struct fully, and only set the non-zero > members explicitly. > > Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace") > Cc: Mika Westerberg > Cc: andy.shevchenko@gmail.com > Cc: masahisa.kojima@linaro.org > Cc: "Rafael J. Wysocki" > Cc: Jarkko Nikula > Cc: linux-acpi@vger.kernel.org > Cc: Lukas Wunner > Signed-off-by: Ard Biesheuvel > --- > drivers/spi/spi.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > Tested-by: Jarkko Nikula