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.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 A73BCC4321A for ; Fri, 28 Jun 2019 04:15:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A48020656 for ; Fri, 28 Jun 2019 04:15:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a1obBfBO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="mwWKHR4g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A48020656 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eUSmenpCdpCkmaFh5nghpg2Kk6DC2cKz1aQgylt0pEA=; b=a1obBfBOCa0j82 T6U9snDHct3GUFyU++q56SxzIN2gJ1kCHCaZBOBQtYC/p4UXdyeT9YkiOKmmNqywzXusw6ULRVrsl uuq8GYZqo8nru10kAHWi+UzlXWpHDLWAiJCC1ChG6xwKSZkIFFJEB6IN8qFqhok73uT12/mNSheCp 68S4DmOnHHkHiJgMfzNswINF0KMo0YArkT1XH5iwFcviAmhmQg1SOaMpE7+egvQrXGoI3yNdnJBQn y33Iz6EcLPC3iVHi5HAaTGpVm1eswW+3GTn050i2U434ejRPnJtxoMPZ/t74O1G1c25wXlrfAgDpm +Gy8H2+EllvYIBv6wsLQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgiI8-0007vM-6i; Fri, 28 Jun 2019 04:15:16 +0000 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgiI4-0007u2-O3 for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2019 04:15:14 +0000 Received: by mail-ot1-x344.google.com with SMTP id q20so4657499otl.0 for ; Thu, 27 Jun 2019 21:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=alHSV6X/0jYcdmtS8pNTXOWz4fHsYwIu+SIRyai8F4U=; b=mwWKHR4gsiFZhFc+g9iiDBf3ria3CPGJBcUKNVbrOil9jxBOb15bPSedkQ6i24jHB2 kgq9cPIPT5bdCFJOdW4vK/Cj6Q28b75Jdtg4+A+nn49Ju0ZMez/bP3llj4+yZRpmC4m1 OAilLA/8XG4laGNg6ziCWw8QLmX1BfNw/A3dGxRtKF5WhMpH3wnILuAUhnDo3Ldro3Ja oQqbhOTpK+MN0Xu75Uru15bz0iInVn95zDCzLcEIjC1zcbaU8cbBCd6DeFDEM46JNzad JE8vF0BXoRqPNCBw1IJndTkL244uCMNW7mfJvMaJLegyUECwNOQD0lWoch5vlqqg5d+D avLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=alHSV6X/0jYcdmtS8pNTXOWz4fHsYwIu+SIRyai8F4U=; b=W4LwL83n7sbrrkGl5QDSi1MhlboD+oMc7NHL/Esi0Xd5waWpR+RZGglVrpZzYPRtyA pxe7oA5khv+SDuDFsX01uXxF+v8WRjfP9IfXmwogBNunJ3eBws6ck+QQSdo4B9LCQafc Nvo+M1kCZS9mzfsJJ9e/KlyK1noVYHzJXCzr2h7PlLhEGb1FVrLsrUk6dAtupb+hVNvm RIFMgnMvi5ie7u5oFtyy/56Kdiie6OHAOSYs2pW6Di2DMHAnhUulnJgCnrRRjOkKdDyF ME6xMc0mJW3648SKPzI/zhaJkEHsVcyOSVazi/zhY6BbrFbNybfgRJGVgOI0wMtkc+LB UuSg== X-Gm-Message-State: APjAAAVKQbnUpz4EZ3vT/aLKK7mPSQNBdZoK8WkCys4mtfbyXCYJ8INt wrklMlAib+N0VaaMS1ErZ3SCLwmm59RjKxqBoX0= X-Google-Smtp-Source: APXvYqzoN5kA1YyGVtcEAFkQBTUlTjcCxJhJ1rQg63DQ4NxitIRUZ2Osuk9gZslYzS51V4HANDD59jPadH78m0yUWGw= X-Received: by 2002:a9d:6d8d:: with SMTP id x13mr6286370otp.6.1561695310932; Thu, 27 Jun 2019 21:15:10 -0700 (PDT) MIME-Version: 1.0 References: <20190617165836.4673-1-colin.king@canonical.com> <20190619051308.23582-1-martin.blumenstingl@googlemail.com> <92f9e5a6-d2a2-6bf2-ff8a-2430fe977f93@canonical.com> In-Reply-To: From: Martin Blumenstingl Date: Fri, 28 Jun 2019 06:15:00 +0200 Message-ID: Subject: Re: [PATCH] net: stmmac: add sanity check to device_property_read_u32_array call To: Colin Ian King X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_211512_813795_21B7245F X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.torgue@st.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, peppe.cavallaro@st.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 25, 2019 at 9:58 AM Colin Ian King wrote: > > On 25/06/2019 05:44, Martin Blumenstingl wrote: > > Hi Colin, > > > > On Thu, Jun 20, 2019 at 3:34 AM Martin Blumenstingl > > wrote: > >> > >> Hi Colin, > >> > >> On Wed, Jun 19, 2019 at 8:55 AM Colin Ian King wrote: > >>> > >>> On 19/06/2019 06:13, Martin Blumenstingl wrote: > >>>> Hi Colin, > >>>> > >>>>> Currently the call to device_property_read_u32_array is not error checked > >>>>> leading to potential garbage values in the delays array that are then used > >>>>> in msleep delays. Add a sanity check to the property fetching. > >>>>> > >>>>> Addresses-Coverity: ("Uninitialized scalar variable") > >>>>> Signed-off-by: Colin Ian King > >>>> I have also sent a patch [0] to fix initialize the array. > >>>> can you please look at my patch so we can work out which one to use? > >>>> > >>>> my concern is that the "snps,reset-delays-us" property is optional, > >>>> the current dt-bindings documentation states that it's a required > >>>> property. in reality it isn't, there are boards (two examples are > >>>> mentioned in my patch: [0]) without it. > >>>> > >>>> so I believe that the resulting behavior has to be: > >>>> 1. don't delay if this property is missing (instead of delaying for > >>>> ms) > >>>> 2. don't error out if this property is missing > >>>> > >>>> your patch covers #1, can you please check whether #2 is also covered? > >>>> I tested case #2 when submitting my patch and it worked fine (even > >>>> though I could not reproduce the garbage values which are being read > >>>> on some boards) > > in the meantime I have tested your patch. > > when I don't set the "snps,reset-delays-us" property then I get the > > following error: > > invalid property snps,reset-delays-us > > > > my patch has landed in the meantime: [0] > > how should we proceed with your patch? > > I'm out of the office today. I'll get back to you on this tomorrow. gentle ping (I will be away for the weekend but I can reply on Monday) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel