Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3097314pxj; Mon, 17 May 2021 17:42:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrYBRzgGNwGxqjqzaUD7XxTphtR8EEW5eUTqltdz89WrB6o1U7Ysm99SCcjoAtJLoTyvbG X-Received: by 2002:a05:6602:2596:: with SMTP id p22mr2137054ioo.184.1621298560934; Mon, 17 May 2021 17:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621298560; cv=none; d=google.com; s=arc-20160816; b=WKZfDjKZlUPRg9x7Y4GwVhcs2qWBmk02UPYOA0lWIc7Y4+u51Zbsz6XmF64WnUWbIf vQ95J8wQaR+C3lfUP5r2hAni/IgAC7Cz1Xcn1bfUxtVxzbeU6tXFHCTPutWpyI0xFIoj /HlIbdNRdIHsv7tSxr0KsoAacZ1k3yp7sMxNIetiZ0bCOR+3ANB1PaUGZZ4E8BmGrwFk B789vxts37qRtpqRdoH4qfNkZDaAxJV4S/WaZ0S/GyTnAy+PlPFom10+txSdCa7CSSha 4IfFRFFB9ZP4mWOGWfOLTNAA2CU5nJ+/6b75xaAqdqm9/WMdb3i54f5GKdvOqIl+RA/7 3CFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IA63Ms1RByrw64KiHH5FdEr+yz7JlMAKlDlI6cT5d8U=; b=nXiiRrs9Sk0n836IZqpd/6BA8ZxergzUf3WvV+5iCngW9lgoh9US1ti6Y2ZsHXkwJe HBLZW9irs0Gx2cDCWiOVawT/mAWHap4FqBvp7HS15Jo7rEDxuysu4/9LgDR5HgzCvc4a 1mzEGztFoTu4GIpx00bq/IowrILFwaVOtnwCotXdBmSPclTaOpnmfu1gwbInq3yF2t2U lQQB2ONXoIe9JWSiXMiywdcPt+xlmkKVA8/XhboF17bA8LndKG924yJ38Zm2gVm4eGJz TJwIKoXgOBEl7pDS5IUgKrKKPi+0ny8C7Ck14KTLEj6BGpOJzqZ84M3Lx0O/6GTkwx6C 7zCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k0nqCq8S; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si2359959ilu.79.2021.05.17.17.42.27; Mon, 17 May 2021 17:42:40 -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=@linuxfoundation.org header.s=korg header.b=k0nqCq8S; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239498AbhEQO25 (ORCPT + 99 others); Mon, 17 May 2021 10:28:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:53288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239477AbhEQOYN (ORCPT ); Mon, 17 May 2021 10:24:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94E8F613CA; Mon, 17 May 2021 14:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260763; bh=eEX47t8Blvdc1dzKaJqVTN5AcqJFqloXWtPtdTGvwYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k0nqCq8SSASl7+G1vq1wJwQQvNdJFpA9RJ2ne1IW72SJrt/OZ1x01Mk8ZqnxvWLME m9SNnxN8JZ6MMrcsKNk3Vu4/hIeQVNfouSfhLW8xVokihSnEQaaRUQ2ji3ILOyA+/H usrBJXq785HA4zXv2fwdivCuhjhBCUnk+oMVIbvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Manivannan Sadhasivam , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.12 230/363] can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe Date: Mon, 17 May 2021 16:01:36 +0200 Message-Id: <20210517140310.357568462@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 4cc7faa406975b460aa674606291dea197c1210c ] When we converted this code to use dev_err_probe() we accidentally removed a return. It means that if devm_clk_get() it will lead to an Oops when we call clk_get_rate() on the next line. Fixes: cf8ee6de2543 ("can: mcp251xfd: mcp251xfd_probe(): use dev_err_probe() to simplify error handling") Link: https://lore.kernel.org/r/YJANZf13Qxd5Mhr1@mwanda Signed-off-by: Dan Carpenter Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index 799e9d5d3481..15b04db6ed9c 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -2856,8 +2856,8 @@ static int mcp251xfd_probe(struct spi_device *spi) clk = devm_clk_get(&spi->dev, NULL); if (IS_ERR(clk)) - dev_err_probe(&spi->dev, PTR_ERR(clk), - "Failed to get Oscillator (clock)!\n"); + return dev_err_probe(&spi->dev, PTR_ERR(clk), + "Failed to get Oscillator (clock)!\n"); freq = clk_get_rate(clk); /* Sanity check */ -- 2.30.2