Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4157911pxv; Mon, 19 Jul 2021 18:46:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJZlMTD/baXxxWIW1ESrFFqmetMTiWcTw1dFScBcE24+IXq7DME+gAGWGN3QJfh/eQFLI5 X-Received: by 2002:a92:6d03:: with SMTP id i3mr19254047ilc.66.1626745607195; Mon, 19 Jul 2021 18:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626745607; cv=none; d=google.com; s=arc-20160816; b=cuONfxzbrg1ninmV/5+4nL9mmHtl0cigKIZkmXSm8bZj21UstR2RCDv3EzBT3vkhoK 6TB/+NZJGv/eHgjRKewxn3W74oid1HTd3qi7R9/hJvMWUk4KJdqiMubXAtymF+CwWA4C We5EnZtKPG3kFF7PrLOP3jgwYzjNAwF0lE75Xqu+YVStVxGSfp776VuG5OD06PMK9RTP cW5/0gPnC1NFghl7Qa9auEAv3efAA8HZDmte9eaWYo5jxviCb7URG7AmiOl7nAQdsITV PD/AWubmWCc7WEJzA/joeBU7bbQKTyOJ7SBOE3GT1W/vQBeWsS5+oaoSRTH0HXJaFxHq fMJQ== 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=VwgkX/N4Vo2dxLKLD1Qsc38x1mfb5BepSM7zbULh/OE4znuWYqYE+lfUn0tShRw04B tJ1oFdWkj0BQ0AaLHmI0NQarbNuRb4/81Oj+UEGyJUUQbbWZBx2cRmuHfer4gI5fTkT/ ZqVa5HZE9FUKx6nmMj1E4V2xGlQlcjjTwp9hiU7gPBJ5RS/WS5mrFex/Tyzj5/afBT+n 7XdclYK37Zx7rmp0PcBkdsJaZ5COO5XMIGR2a+H4WgmANgofhqmth4IXaeiiggKCTuFI VelR2RyH6Pf1b73CKv0+gL9PORCVHfqpD5ECl36PbQdgDByZzvNZQHjm3W8Fj7np/yin jgOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TG9ruv2n; 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 b20si12546234jat.16.2021.07.19.18.46.35; Mon, 19 Jul 2021 18:46:47 -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=TG9ruv2n; 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 S1344809AbhGSPCl (ORCPT + 99 others); Mon, 19 Jul 2021 11:02:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245425AbhGSOii (ORCPT ); Mon, 19 Jul 2021 10:38:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F39961264; Mon, 19 Jul 2021 15:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707880; bh=NX6T+JQ4U5W0efBTMO+eLxTbyA6wx5uiLGWaPQPm6QA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TG9ruv2nvlZ/IxXnJNNtHAdunNjGOQOsWScGr2pFVbJ81BlHdkKUkVON3nuLN1QUH BB/Aba7IP0c8YR+mR/BhQFC/CPcV2QPJJ5ZXcM/W/AUNySv5jQevs9h8GuTASAvztq bxw8B10Wvxii/Mvku37sWngQQ3siSARBihum/gYE= 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.14 093/315] crypto: nx - Fix RCU warning in nx842_OF_upd_status Date: Mon, 19 Jul 2021 16:49:42 +0200 Message-Id: <20210719144945.936242535@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@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