Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3768880pxv; Mon, 19 Jul 2021 08:19:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIZ11UEwi6hE1M4DF86o3kglrVIdDvRQ22CC8NlZYIkFOypMIUVjINhXOy1fkOx6l5mUnr X-Received: by 2002:a05:6402:2919:: with SMTP id ee25mr36024130edb.222.1626707943005; Mon, 19 Jul 2021 08:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626707942; cv=none; d=google.com; s=arc-20160816; b=vjkZQGL7I0j0eBvayWGI1TuHxJupnOszFCNMWBP7S65Qv859ZXGUQYEWKCbDIoHFE9 yO0WkGud4tALSMgPkBQhu+StY3iNwSpvqumjQasatMJle6+pnNHryt6kfHVJvr0yB/kQ P0nIlxSur+9gouAn9ksq71hoFPAdE6sSt8YxhrWm3TaSaeQYSX1vehXbTQuyHuZrryE8 uAVj77lse+HseDOL21kyRQLoCoT9azTwbW+EXi8SttoOlHCmzxlLDCDjxGzbcp0XrcIk WFpQf4PVVreIg6y3UOqUmuGZZQaPO5E0P0/CDTPHZTjyGrdDF+cKLJlwBa719Z5N7Y7U AOWg== 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=VPakdVe6+pZdrlucQTQAoq0ZTWNn/QC9BHW8cZloXAg=; b=IkB6QS9X4jhB8H5UOakMl4CTEdBaMlJSmHhm+iSIh03ygevhGkCPM5epE4F6vWOezB 5cwxGswHySWWWzhKB2M1Pfyl+1cJxrabhZ5MgGBn79gn9lQk2CyU+L9hgvo4oOk3eCF6 RFFPdMBe/J2wLDcqvjZG6p78kViOPw7+uHp7uMdCCtQX8yInPW6p2wdcLH+Pa4dUpmfS a3VRj9bGdqDUut4I5yTI1JFXnv0uUAStW5vmyth3dK48X07JkoT3WTMNkveBgfUsUzwk IW9Mr4rvTcaaa4hkr1De6I4BBBi6suFhPhIH/ze9hyNy0LOWDB/TltTPjjOzc4gtYvYj SgtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OelRV7Al; 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 oz32si21133542ejc.718.2021.07.19.08.18.40; Mon, 19 Jul 2021 08:19:02 -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=OelRV7Al; 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 S245434AbhGSOeg (ORCPT + 99 others); Mon, 19 Jul 2021 10:34:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243126AbhGSO2x (ORCPT ); Mon, 19 Jul 2021 10:28:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 992866124C; Mon, 19 Jul 2021 15:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707302; bh=NX6T+JQ4U5W0efBTMO+eLxTbyA6wx5uiLGWaPQPm6QA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OelRV7AlRuuMQv9acS5+f9bKQkgReEi0V42W4HN+ORawDpYwjGfPNe6awaVUOL5Ue rbsJkyD58tyAKkhc9gIX7cfhGPIxt9bu6/VSnyQ7hY2M2Y3LxnfEjpLWMsRxN11Y37 toD5/nk2b2tJLKuXLW+HS8CMwlcrG+j38nHcRjas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Xu , Sasha Levin Subject: [PATCH 4.9 072/245] crypto: nx - Fix RCU warning in nx842_OF_upd_status Date: Mon, 19 Jul 2021 16:50:14 +0200 Message-Id: <20210719144942.741900185@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@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: Herbert Xu [ Upstream commit 2a96726bd0ccde4f12b9b9a9f61f7b1ac5af7e10 ] The function nx842_OF_upd_status triggers a sparse RCU warning when it directly dereferences the RCU-protected devdata. This appears to be an accident as there was another variable of the same name that was passed in from the caller. After it was removed (because the main purpose of using it, to update the status member was itself removed) the global variable unintenionally stood in as its replacement. This patch restores the devdata parameter. Fixes: 90fd73f912f0 ("crypto: nx - remove pSeries NX 'status' field") Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/nx/nx-842-pseries.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c index 2e5b4004f0ee..1b8c87770645 100644 --- a/drivers/crypto/nx/nx-842-pseries.c +++ b/drivers/crypto/nx/nx-842-pseries.c @@ -553,13 +553,15 @@ static int nx842_OF_set_defaults(struct nx842_devdata *devdata) * The status field indicates if the device is enabled when the status * is 'okay'. Otherwise the device driver will be disabled. * - * @prop - struct property point containing the maxsyncop for the update + * @devdata: struct nx842_devdata to use for dev_info + * @prop: struct property point containing the maxsyncop for the update * * Returns: * 0 - Device is available * -ENODEV - Device is not available */ -static int nx842_OF_upd_status(struct property *prop) +static int nx842_OF_upd_status(struct nx842_devdata *devdata, + struct property *prop) { const char *status = (const char *)prop->value; @@ -773,7 +775,7 @@ static int nx842_OF_upd(struct property *new_prop) goto out; /* Perform property updates */ - ret = nx842_OF_upd_status(status); + ret = nx842_OF_upd_status(new_devdata, status); if (ret) goto error_out; -- 2.30.2