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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 67C24C43610 for ; Wed, 10 Oct 2018 16:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 382DA2087D for ; Wed, 10 Oct 2018 16:08:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 382DA2087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbeJJXbJ (ORCPT ); Wed, 10 Oct 2018 19:31:09 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:43524 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbeJJXbJ (ORCPT ); Wed, 10 Oct 2018 19:31:09 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9AG4LqF001888; Wed, 10 Oct 2018 11:08:04 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 2mxu495fkg-1; Wed, 10 Oct 2018 11:08:03 -0500 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id 0C46D611E12A; Wed, 10 Oct 2018 11:08:03 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Wed, 10 Oct 2018 17:08:02 +0100 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id w9AG82QA021446; Wed, 10 Oct 2018 17:08:02 +0100 Date: Wed, 10 Oct 2018 17:08:01 +0100 From: Charles Keepax To: "Gustavo A. R. Silva" CC: Richard Fitzgerald , Linus Walleij , , , , Subject: Re: [PATCH v2] pinctrl: madera: Fix uninitialized variable bug in madera_mux_set_mux Message-ID: <20181010160801.GB1653@imbe.wolfsonmicro.main> References: <20181010151313.GA16854@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181010151313.GA16854@embeddedor.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=701 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810100157 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 05:13:13PM +0200, 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 > --- Acked-by: Charles Keepax Thanks, Charles