Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2524174pxy; Tue, 3 Aug 2021 08:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsjP48IYQvv+hLCcsBdzPJSg27gjm7AqZoKeAjVEBsDEDtcrdMxHev2XY74GfNGsLi6O/9 X-Received: by 2002:a05:6e02:1a83:: with SMTP id k3mr269527ilv.150.1628004277203; Tue, 03 Aug 2021 08:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628004277; cv=none; d=google.com; s=arc-20160816; b=mIdAfpO2aAYDtiRojqORZrNxFOjgwEHNFd1ax4YFsLT9sw3vuCnMrlAG70WlSW/BQ3 XwXs0g2VdPuLObVXFR6SW3mxw+FJhXemel2K229WR0JfNc+ZvxY4S5lBhd19YCWfzjiC +QV875DE+5m80r0C6BtFYGrQDcefT6zOGp/FjyZ0Gm01Iw9rTmniTyrZQGxWmVN7LrFL RuM0sbe+soWb2iB4l34r5QjWVUVeuM6qtq7nfJnewvYTvwZxNJa7JSlHmLHJUfrlksaI id3AfRnWVwb8KjWcL468rG5Y5HG5kCl6aWEL0rPa6XOaRnZ2JyokRjORfLYIkHP6Sauo 5nbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to :dkim-signature; bh=AAtFa3uqU80R71CuDcjQT6vhZ/7Aa3Do+6cYN2ykiig=; b=nUMtp8hX7y7/owWVlfuWoj/IqeyiRZCbdXouMlJIvk0AyiBHOBVEGjtQ3neR84exlS i7TdxyxnPwdMVFii+9Va+jt+tdO5KC35iBhwVXrBRvOJy/Y73vWyd8CfLPKmC25jjB4a FDzinj2q+vYIl6Mu/T84zdz8NKlotbHqJTudnzUtHnd+jdamrqTuZMNeDpvq7ZHQfaag cVH/Ev2+zOlh62BZA3do32V34o4Wn/hoRZ55b3HSGHpsKw4/A52hc8ABDqRpsmPDDtUe 4W3Z4zKNrpPY8wprC9+WQqcp52sACglIra8kOLQ+np6P/nNA/VXvL6adjK2Vi+Dv+bcM 3ypg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=AN+sUgU8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si15097763jaf.48.2021.08.03.08.24.25; Tue, 03 Aug 2021 08:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=AN+sUgU8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236688AbhHCPXk (ORCPT + 99 others); Tue, 3 Aug 2021 11:23:40 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:57960 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236145AbhHCPXj (ORCPT ); Tue, 3 Aug 2021 11:23:39 -0400 Received: from [10.172.193.212] (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id BE1D43F07E; Tue, 3 Aug 2021 15:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628004207; bh=AAtFa3uqU80R71CuDcjQT6vhZ/7Aa3Do+6cYN2ykiig=; h=To:Cc:From:Subject:Message-ID:Date:MIME-Version:Content-Type; b=AN+sUgU8X+kJSPIFvbEy02kCsEG6PetoUJHJ8aLMKqUuu4f3vAdxVofgt/ojdjsUc i1GEb0g8A7WbMSoPoP2ddfQqYWL29HJeSiiahPWTYjo5uschzIGCf1kmhtp1ZfVJZk i2BMt3UBaUa/XYDjC3bhVCpwCa8NERSUoy19YLK0IV2vujrnfoI814q511W+NSMZaA qVsYXbScN+yIjau8PmrNbB+RqrwXpvgk2cQ7W20hP52NhUyxamzjRtH9oK5ur1j4g2 unK5vk0pQaoCx7DLCXU7jQPxh6Q7Lb+/gnmBjfncO0/1k6cg0YtEa5fOPOYUnscXKG PUBvhxu8vwOZg== To: Angelo Dureghello Cc: Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Colin Ian King Subject: re: can: flexcan: add mcf5441x support Message-ID: <7c80c17f-e38a-8fb1-f3c7-987187a2c4d8@canonical.com> Date: Tue, 3 Aug 2021 16:23:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Static analysis of linux-next with Coverity has detected a potential issue with the following commit: commit d9cead75b1c66b4660b4f87ff339234042d7c6a5 Author: Angelo Dureghello Date: Fri Jul 2 11:48:41 2021 +0200 can: flexcan: add mcf5441x support The analysis is as follows: 650 static int flexcan_clks_enable(const struct flexcan_priv *priv) 651 { 1. var_decl: Declaring variable err without initializer. 652 int err; 653 2. Condition priv->clk_ipg, taking false branch. 654 if (priv->clk_ipg) { 655 err = clk_prepare_enable(priv->clk_ipg); 656 if (err) 657 return err; 658 } 659 3. Condition priv->clk_per, taking false branch. 660 if (priv->clk_per) { 661 err = clk_prepare_enable(priv->clk_per); 662 if (err) 663 clk_disable_unprepare(priv->clk_ipg); 664 } 665 Uninitialized scalar variable (UNINIT) 4. uninit_use: Using uninitialized value err. 666 return err; 667 } I'm not sure if it's possible for priv->clk_ipg and priv_clk_per to both be null, so I'm not sure if err can end up being not set. However, it does seem that either err should be zero or some err value, but I was unsure how err should be initialized in this corner case. As it stands, err probably needs to be set just to be safe. Colin