Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2708455pxv; Sun, 11 Jul 2021 23:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0jYjoURfx8SvuaGHxprNZHsrO0hzr5BL+h3wSJItnxDsFiEBj0zq7cHPJD/cwKnKNvhif X-Received: by 2002:aa7:d554:: with SMTP id u20mr63091797edr.50.1626071040607; Sun, 11 Jul 2021 23:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071040; cv=none; d=google.com; s=arc-20160816; b=r+v9sXzAyugamwYPyqgWODxK86PaJtlpenQZRMPLxrUfxHyEL7lbv6hNzeR2IMLKYh 9LdDFrxceMv8b4DAZQ2HQ4vYdpj7ptUr18gBh0Yb2rp2LRNdQSw+n68J8UfALeLwt6No PLHClkKtfqjRsyVtLGV8Q8M2Cd947iXP4Ika6hb+NT7cr1rF7FerA5lB0OM4bvNzlzhB rKrL9bpvcYy57atndPJJQk+NcVx7j8OIG/Fn1PIpe9iOxcsvZvtzHKRzKUwnDPkckG/V GsFKSqBN1LqIMJ6BzKoOVQIs83ZjCozuB3xFsDk+24eN49YYOEnfFBs+EZ/jCVP7dx+6 UlAg== 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=soJ9SWmWXEcrUgMukooqboj4ts5Cm/iACL/EYEfidY4=; b=I3OsYP3N9N094RQIKXVRwwk1iUc+T7Cjw31iMoA6QhZ+jWNf1cyunoZpueqmbW/dGn p3phZGRy0N1jTycxqjsD07Yskui/EK6KUBg++JUyAX7jSHGIKu3nJHkoa0hcFXjQuPX0 0AwrYn7a0W/rv1PNIxfp+jAXcLh7iR0toBSkX49MDJGOhQEIU7iSLivLUPm9TZI7elIY 0PtO8pOXr8/QhBTc1gqzNl9l+Sbe2rF+3qW5PhMyaoeC/qhGFmQfz29pLABQCgvsojK+ Vka6mEFNZ5jpJBP7tdaEsloyxA7PIsCIvgt481Mu/R9Y0V9pjmrWs2w1kKCEmg2WErBc DGaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hq+JPOC3; 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 rn4si18196696ejb.0.2021.07.11.23.23.38; Sun, 11 Jul 2021 23:24:00 -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=hq+JPOC3; 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 S235065AbhGLGZ2 (ORCPT + 99 others); Mon, 12 Jul 2021 02:25:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:40254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235020AbhGLGY0 (ORCPT ); Mon, 12 Jul 2021 02:24:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6E3D61186; Mon, 12 Jul 2021 06:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070864; bh=n+KLKmhYLsIkH/9PCdHkKTuX0Vlmc6T3wEKfw8lSxsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hq+JPOC3TPuZU/EgTbMWUo5YfIkkDijGUT4t2BmQlZYyxY5bxvkCia2NZgGxRmNmI itxtXCPLNOtHiNVhWFqPcE8lY00NxVHqKxek4lPPM749uDWeYFC4PgJK9z0H4O7ell irCP22S35xaf/5z/Ei3Hyc2fezLMNfscOJOjyX3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Xu , Sasha Levin Subject: [PATCH 5.4 174/348] crypto: nx - Fix RCU warning in nx842_OF_upd_status Date: Mon, 12 Jul 2021 08:09:18 +0200 Message-Id: <20210712060723.991457019@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 258c5e38a551..c5ec50a28f30 100644 --- a/drivers/crypto/nx/nx-842-pseries.c +++ b/drivers/crypto/nx/nx-842-pseries.c @@ -538,13 +538,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; @@ -758,7 +760,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