Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11449790rwr; Sat, 13 May 2023 03:59:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CbxgEVTgXPV6tNYZQifDXeWRKuuuUJuTam3l3UHlAB6vnv4i4q+YcFjtU2unFv/WWnh+s X-Received: by 2002:a17:903:124f:b0:1aa:f6e9:4cb3 with SMTP id u15-20020a170903124f00b001aaf6e94cb3mr35370680plh.52.1683975574570; Sat, 13 May 2023 03:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683975574; cv=none; d=google.com; s=arc-20160816; b=MWnSrk543xmJ74lxj6J0gvseZByXJBDQpQNcW0g5DtunuPoFRyXvyAe4rUJ3AC72qI l10vxNkr5yZDXFJ5Mq6DIJhNgiLw6I6SE5uDJhajDwEC+5eyKgkXtqNI6FINpvUtFHBJ nXst03fPG67wXUut+umLKttL4K8voDd2iATOXBVsSa+phd2ukqyOKJRgAO7Q6aRuHRSx EAP4csj/vlqs5ARmh9sxY6Ft/XBHChC2BewqWQETL6tiOo2I2mlUZGxx9mXX9TkEXu0T Fsidt4PX3ytlYyDRc2fBzUeoaboZ0Qa0SnKzcR4rI2RxshoqrUyqFf2B1Ic+2fTAVI90 gSDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=N53w+kPGQqnVWx5dbJRKyhTsfmQo4Or3B/HUIiFYQks=; b=UlugjtT0vTI23liYkryqj52KwzO18VzZcJiDrxDeLU4XEJgUgZdQspOIOypwzKrxlE mYzE9+D4c9J3MF7vE3GkPd4zNVocT/2AeenqxZtIpD7e82aM+0A93P8U2vUrtWNFqP99 Qyw5wYrAEOdjxVXm/Y9zjY4vGDZ1lXLPCzB22TomciAnWl1pN8cpADcbCsTMTQQIG0ye LI48bbPp+JW/FAHJeT3LeJwB87kI3ufh3Oryk3XHJgbVOXWg6RBGnQKwo1cNwbudG8mX arTBc3JL6ceiG1R72OqqfNAljViZb7u/YYVMn8xl6i2xs7wDu9Zl59mfYJNrYG5iA/gG SSqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZlBmZ/ZH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a637a45000000b005303a26dbf8si11246612pgn.408.2023.05.13.03.59.22; Sat, 13 May 2023 03:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZlBmZ/ZH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238046AbjEMKcH (ORCPT + 99 others); Sat, 13 May 2023 06:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238148AbjEMKb6 (ORCPT ); Sat, 13 May 2023 06:31:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 267A42D48; Sat, 13 May 2023 03:31:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A094860DC6; Sat, 13 May 2023 10:31:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4203C433EF; Sat, 13 May 2023 10:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683973913; bh=u50lLtvY55sXJ6aAw7TPVTe3dvV4Gb02rVRmx7/nGog=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZlBmZ/ZH3vTLqfj7Br+NXVtQxakLYeVMCWh29YPYaO93jKy4gMCMyFNpqZrr4xZpb uy4Rq+YDJbcF89Tb2VDO/MLxSJ+YQVh5rUN5RbewmNQEA3q+WdTjS87aG0Fq1ChrmV GR6AxXOep1JzNCmUPjb9PvVcWmDktQFbDBy4r0hU= Date: Sat, 13 May 2023 19:25:03 +0900 From: Greg Kroah-Hartman To: XuDong Liu Cc: Al Cooper , Broadcom internal kernel review list , Jiri Slaby , Doug Berger , Florian Fainelli , Dongliang Mu , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch] serial: 8250_bcm7271: fix leak in `brcmuart_probe` Message-ID: <2023051354-tubeless-footprint-973c@gregkh> References: <20230424125100.4783-1-m202071377@hust.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230424125100.4783-1-m202071377@hust.edu.cn> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 24, 2023 at 08:51:00PM +0800, XuDong Liu wrote: > Smatch reports: > drivers/tty/serial/8250/8250_bcm7271.c:1120 brcmuart_probe() warn: > 'baud_mux_clk' from clk_prepare_enable() not released on lines: 1032. > > In the function brcmuart_probe(), baud_mux_clk was not correctly released > in subsequent error handling, which may cause memory leaks. > > To fix this issue, an error handling branch, err_clk_put, is added to > release the variable using clk_put(), and an err_disable branch is added > to meet the requirement of balancing clk_disable and clk_enable calls. > > Fixes: 15ac1122fd6d ("serial: 8250_bcm7271: Fix arbitration handling") > Signed-off-by: XuDong Liu > Reviewed-by: Dongliang Mu > --- > The issue is discovered by static analysis, and the patch is not tested > yet. Please test it. thanks, greg k-h