Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238890pxu; Mon, 23 Nov 2020 15:37:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqHRXLQbbVfpZWYwCanzwU4Doai+75MAVMuxFuwCGpBR3wOKQP+leA66Kk5gRndYNwZiIf X-Received: by 2002:a05:6402:1644:: with SMTP id s4mr1507056edx.221.1606174664216; Mon, 23 Nov 2020 15:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174664; cv=none; d=google.com; s=arc-20160816; b=k5FWIiRRr7F1WaRNqWRMLl/JH1DzSkyczAyzgaR5lOBJJ8KRkAFzTvKblEAU46idCr ccrMbpJWk9vQbt6F/q2khTh88Sao7A0Oc0PnaoGBTQs1SWOj2jzmFhISRMsDfloTGprn /LyS41AOuWdnkutmSaxEOjg+rwpJodbpyoblp05Cx2aXl1vGB+Otjh/BE0fjml4TNprP D331+yIiYIawoFN5dAq+TNe9E0y39G6m/TrDb0G3LMFFkDvw2vmqJ/aHsvuJPFSnRhey wsQGVq1Oo4IrfRTVrEc8PvKmpEuVZW+Pd1jzR0Jdbic1PJ6AlwlcJzKA/QOkPcBT5Sgn 3TBQ== 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=Y8o9OAtQxa62KTQdG4G7PHPwMCwkFNc27Pil+HtX6E0=; b=RA7L9rLOYaAGXDf/NIGfFQ6SfDFBgmGHmNg3pyvbPKhDqXw1vk0dU20t3XoDbTAwyX MvXcLhyhYl9+rmI59KM9aqVJipiLR1AaYs94M1bT3g85e7fapj41zby87Z9w+3NgY0Pa n2LNfAKE2Hpf+vZcEzOJwY7g9RZv6kf/oiYsk6NOuIU+WO2pscEAaBsgegVFxaNVhi/u DIExUsl02Fmbwjzb8ifw0Ol74wf6CESQaFNDr/nroXgrQpnuRd3rmoO/S80qBO3LwhG3 cco+g0I8sSzenAgDsbw6IHul99LGDAwo9m9b3zVcG6r8vEqXlS9A7dj27eSLw/EPgqY8 bBFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PaBHNwXO; 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 o19si7836621edv.435.2020.11.23.15.37.21; Mon, 23 Nov 2020 15:37:44 -0800 (PST) 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=PaBHNwXO; 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 S1730564AbgKWMhZ (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:49634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731901AbgKWMhX (ORCPT ); Mon, 23 Nov 2020 07:37:23 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8762620721; Mon, 23 Nov 2020 12:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135042; bh=e7Nfs1fEbrEW9QHMg55mA9MA2ndlLBlNjfWDdm6fPKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PaBHNwXOAjpXFHjn+OUKGJ78LbrQdAVZIlIxe2BQ+DYr3iHLVDoG2lmoRFNX3+4st 6bl8WYapAz7Hr/jQAOrg7vLAmRtOC/cEnaCZhFEOKyT/lN+EQ+2RaKctRwBTAEQzqM Db9xoyZKUwat87OJAnurYDMM/fJdBCRw8q+qZx+8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Murphy , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 083/158] can: tcan4x5x: tcan4x5x_can_probe(): add missing error checking for devm_regmap_init() Date: Mon, 23 Nov 2020 13:21:51 +0100 Message-Id: <20201123121823.936901951@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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: Marc Kleine-Budde [ Upstream commit 1ff203badbbf1738027c8395d5b40b0d462b6e4d ] This patch adds the missing error checking when initializing the regmap interface fails. Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Cc: Dan Murphy Link: http://lore.kernel.org/r/20201019154233.1262589-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/m_can/tcan4x5x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index b233756345f83..11c223a534887 100644 --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -467,6 +467,10 @@ static int tcan4x5x_can_probe(struct spi_device *spi) priv->regmap = devm_regmap_init(&spi->dev, &tcan4x5x_bus, &spi->dev, &tcan4x5x_regmap); + if (IS_ERR(priv->regmap)) { + ret = PTR_ERR(priv->regmap); + goto out_clk; + } tcan4x5x_power_enable(priv->power, 1); -- 2.27.0