Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1912421imm; Thu, 11 Oct 2018 01:45:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV632bzKJgENDq25ALhKtvyUvk75onz9zj9S2sBZPdBvocOFcDp1v+rQECYTXJKuMraFTLfft X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr662350plr.83.1539247531257; Thu, 11 Oct 2018 01:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539247531; cv=none; d=google.com; s=arc-20160816; b=Sv00OY6rdDJWMw5lOSOMdm2tpxt5gNozcDY6YxZv7HJMl6zMbP8U8kQ2lfoHCrPgNa W8GR50u5zBqx3sZczzW7jVhUweERnww9LitK3jJMbsetkn9tHsG1H7GOwk9ZiKAFzC0i 70/u21Zn7DPogQFZkqDB5yVxyzk4EGujMVD59d2cpmEGcyeh8vB9g2/VjGZ4Cp53+fMP 1Zjtejq+gkhJQ4tDEJZeNwBjBNBojjjvDA8cielvu/27olgno3KSvsvFKxwoVh5XC/9t XVVjkxcMvSP4gZuEkMu8KuV3zSmlIxF0dORBlWtbxoBkLAPbS4r2nqBDQO/2mrY2RLJO vuUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FcykFZeYZ4ioCagMTiF+1qbXALsjWce15a48uHVgIj4=; b=jA+KQroqO2UI0ZWkXIo6G0p8r6drOsKgFHH1tCYgpqcopyZ94gczGlS8BZPVTxetEy doTyUBu5czqsFRmF60NhLiEavHDdPK66t0CsRkNafvek5N0jkrf2MycN13iwFqfEd+Mw 8gyjkjuskyIwZ5GHemDrmsi7KIcQVBVbyW5bt9XaC9lvA6ZivFdLBaIqrngG47toFsUi ynkFzJ+BckwePSn+B9W+6qposRmrddb0j7OKWrpVvfYYWaPMkYPqfZFGodPau7GCeMD2 EZSUNBFbYfQr5jCmmawnuzOOVgkKhqZt6mGQFMiZ7MzxeIXItLOQAt+VLBb1PKQViLoh TUeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jixjxk9W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si23817655pgj.39.2018.10.11.01.45.16; Thu, 11 Oct 2018 01:45:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jixjxk9W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728204AbeJKQGi (ORCPT + 99 others); Thu, 11 Oct 2018 12:06:38 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37751 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbeJKQGh (ORCPT ); Thu, 11 Oct 2018 12:06:37 -0400 Received: by mail-io1-f67.google.com with SMTP id m16-v6so5990342ioj.4 for ; Thu, 11 Oct 2018 01:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FcykFZeYZ4ioCagMTiF+1qbXALsjWce15a48uHVgIj4=; b=jixjxk9WbGaeV0jr0UCG10wvkNQfkk60g9HJhCpbY8k426cDE7BXRlt1yD2r6DbYPa ghUZvTfCq08RwkQKvF3CApZ8CXiBJbCswJRHCkNTh8wkRajlmRSVQ9CmUkPHOEQCiy+b LHCvXOlZqDCBgkZczTCu0fMzPZ3ja5jh+XjqU= 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=FcykFZeYZ4ioCagMTiF+1qbXALsjWce15a48uHVgIj4=; b=GBN9pmrOUj5AS+gdgJM7l/kNa8Ki/MD7Dyxm74ZCwejmefRyLbZ410Poju99ITmf2c z5MMdeBoZv0qtdCVPDElrj8BtowA2p50bdVUGx3d7YKgzPmXxAwluP5zoNTJN0SjK4QM wK7PjvNyJ8u+cdoq5jey3g9qZpG7NoFGZZ3w1ICC5NFz3RCKd+lHRJ4AL1RdOOfYH6bC wmTBVOujBdVpNT9YeI9/rgB09vRMOor9ngT/7YkcmHOTNbCccmG9fX5QvVlk/lfFiVng RX/C+YLGJ6m/RVhwwBQRadBu0GQ9UtEVuamtvWAkNTwu8qtWzEbUT/C5y9PnNWZNJQEk WFLA== X-Gm-Message-State: ABuFfohel3KU2ZKBrtAgpPbH+nUMaACeAHeqrGR9Bj9Xeomviugy+14M i+ApctBg97p3cGRuSv2qEIFnuzzLuNswcF8BhNZBI8bk X-Received: by 2002:a6b:c3c4:: with SMTP id t187-v6mr418921iof.304.1539247221368; Thu, 11 Oct 2018 01:40:21 -0700 (PDT) MIME-Version: 1.0 References: <20181010151313.GA16854@embeddedor.com> In-Reply-To: <20181010151313.GA16854@embeddedor.com> From: Linus Walleij Date: Thu, 11 Oct 2018 10:40:08 +0200 Message-ID: Subject: Re: [PATCH v2] pinctrl: madera: Fix uninitialized variable bug in madera_mux_set_mux To: "Gustavo A. R. Silva" Cc: Charles Keepax , Richard Fitzgerald , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , patches@opensource.cirrus.com, "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 5:13 PM Gustavo A. R. Silva wrote: > There is a potential execution path in which variable *ret* is checked > in an IF statement, and then its value is used to report an error at > line 659 without being properly initialized previously: > > 659 if (ret) > 660 dev_err(priv->dev, "Failed to write to 0x%x (%d)\n", reg, ret); > > Fix this by initializing variable *ret* to 0 in order to > avoid unpredictable or unintended results. > > Addresses-Coverity-ID: 1471969 ("Uninitialized scalar variable") > Fixes: 218d72a77b0b ("pinctrl: madera: Add driver for Cirrus Logic Madera codecs") > Signed-off-by: Gustavo A. R. Silva > --- > Changes in v2: > - Initialize variable ret to 0 instead of -1. Thanks to Charles Keepax > for pointing this out. > - Update subject and commit log. Patch applied with Charles' ACK. Yours, Linus Walleij