Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2961011iob; Mon, 16 May 2022 09:53:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKWvfB8e7KPN7yS4xjbXo2/HGnb54YngVJh8xP7I7fy30U6wWv3VA9q0KtaN6Xz5Z11R3J X-Received: by 2002:a17:906:6a0b:b0:6f4:d4d7:7c83 with SMTP id qw11-20020a1709066a0b00b006f4d4d77c83mr16109269ejc.667.1652720002859; Mon, 16 May 2022 09:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652720002; cv=none; d=google.com; s=arc-20160816; b=NSjoPMRcjhE9L+tOCmFfaEVgEhit5hq2f+MQHCG302rrWEwf2sJj6/bsDfSbFJPHb1 xz/GuLZSwR4ODTo3LQTgbJyxfLurwnJl5rlzi94CsPsmxfehkYGTkr1sL8bCqIarbt7V vJrvhdAzKQaZS/RY4XRqLzwmz8JnumQst/0pmfFWPbJun9Gu300Zcjh1GwSzdKPJ39H2 4En5JBc7G29dyepUOtMMQ6XUwC0jIZ86qBBEgpN+GoY2KgwxAl9BiHfry8MxIK7YxCuB N6EqJBt9r+BsBpatFkxLCI8sMhE39RfWFduUALDviIFsP+qSamydai/GZt5/cD119YK6 YaeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MeiTmWKbfFkyUDAu36ZyhnVOygglTiIR0GOA0B1eY0c=; b=ooobY3JwxTM5fzdOmOLEh38gr8164oDTaO02i5TGmEjIJNpfuuP94BYhYuHg0nGvJY s95X0RY8riJ4x0mIRpPPEu46q+bAIOWTMRSFdisNONINJXMfcLXRqG+hdjemj/YXS+Ak YnFzAtLiFKlbYkXiAttk2B1VDMq9UKsn/XzEvfSShgo2CtRXO4Aj8UCepI7hRn7ThEWC LBbkMTrR65wICZsKMhXx7EN7R5aa1jxQs+0qC7Qc0Zi3Z/eANZqUOP3awoUjNRcbKjQx A6Av9Ep+v3owg4dZv5xRsdHTqd2sUmK4x2E1EWLn9Om5BRTUsiMuWVJukoqUdDaz4tHR UkYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YSvJoVFP; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt6-20020a1709072d8600b006fa8c68ddacsi52944ejc.336.2022.05.16.09.52.55; Mon, 16 May 2022 09:53:22 -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=@linaro.org header.s=google header.b=YSvJoVFP; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244040AbiEPN5l (ORCPT + 99 others); Mon, 16 May 2022 09:57:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244439AbiEPN4Z (ORCPT ); Mon, 16 May 2022 09:56:25 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CB693B284 for ; Mon, 16 May 2022 06:55:57 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id a23so10123824ljd.9 for ; Mon, 16 May 2022 06:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MeiTmWKbfFkyUDAu36ZyhnVOygglTiIR0GOA0B1eY0c=; b=YSvJoVFPtG6bnfTeQxzBBXy77ERTEhTsg7XgRIV7EvSdREsTC+AE70ohYj7+FaK3bh OZ7sjzRe0LmR1tB7sIiFJ86bssbYh2hpR0Y+aNF/BknPMKa7voNiy1bXK6AW9VSd65yv v93gBe0NGiYn3Ng3ITfp5tpi4Zm9UD8CupDajz7yaQAyoxRnLxRhMZUdN71V296ixtDP dkyIm2FRzpKSi0w/RUH3Cd2tWDxZ+pd/bqglKQcNSg/Jn5paNs/SwNzOb+tRvGMX/LUe 855GCPqwIABjYfRzwwNyEXTYySq0ebhv/pRlBayaA8U/7pAbULFuWXgIj151YCTknIOb X47g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MeiTmWKbfFkyUDAu36ZyhnVOygglTiIR0GOA0B1eY0c=; b=IM0oCrXHKk5aH7TlAw4biWtoW2Bev6XcMXZJk30M9XuS5sXTg4nOqkLIzmiabdGjY/ D76HMLVeBvDZVss5jzW6z3C9Z49WG22Q36U+HA/DqahxjhCv3inI1M0Nt9ktbZOko/8P 1Xl9akM/lsc7x8ZHwTid+4HQR2jqValPVFR0kMVCE6FhrayfQk+W0GAJkJS3kRNr6vI0 HztgYPsqcqOPJatjwQEGDcsCuRTj0EEkE6nRVzX5NDpTGRd57o6kGmvTtqhYR0Z+GhXC IyAVRZ4PYaKRRYuIWZus+xPGnVFB4ttLV1tY1gNFUZCc726flovLq2+Oj9gjcGumc+hm tEew== X-Gm-Message-State: AOAM530Xr8tvXp6nyokQ4ydUThLzRnDAYMKLn7+KZ7QJm5v/j8tMedEm 6uhXlqzZJTkE/SrvKPsafAuMfNRIJgSZc4+QT5op2w== X-Received: by 2002:a2e:9e54:0:b0:250:d6c8:c2a6 with SMTP id g20-20020a2e9e54000000b00250d6c8c2a6mr11865448ljk.16.1652709355591; Mon, 16 May 2022 06:55:55 -0700 (PDT) MIME-Version: 1.0 References: <1652339993-27280-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> In-Reply-To: <1652339993-27280-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> From: Ulf Hansson Date: Mon, 16 May 2022 15:55:18 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-of-arasan: Add NULL check for data field To: Sai Krishna Potthuri Cc: Michal Simek , Adrian Hunter , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com, saikrishna12468@gmail.com, sgoud@xilinx.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, 12 May 2022 at 09:20, Sai Krishna Potthuri wrote: > > Add NULL check for data field retrieved from of_device_get_match_data() > before dereferencing the data. > Addresses-coverity: CID 305057:Dereference null return value (NULL_RETURNS) > > Signed-off-by: Sai Krishna Potthuri Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/sdhci-of-arasan.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c > index 6a2e5a468424..757801dfc308 100644 > --- a/drivers/mmc/host/sdhci-of-arasan.c > +++ b/drivers/mmc/host/sdhci-of-arasan.c > @@ -1577,6 +1577,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev) > const struct sdhci_arasan_of_data *data; > > data = of_device_get_match_data(dev); > + if (!data) > + return -EINVAL; > + > host = sdhci_pltfm_init(pdev, data->pdata, sizeof(*sdhci_arasan)); > > if (IS_ERR(host)) > -- > 2.17.1 >