Skip to content

Commit 2a96726

Browse files
committed
crypto: nx - Fix RCU warning in nx842_OF_upd_status
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: 90fd73f ("crypto: nx - remove pSeries NX 'status' field") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5163ab5 commit 2a96726

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/crypto/nx/nx-842-pseries.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,15 @@ static int nx842_OF_set_defaults(struct nx842_devdata *devdata)
538538
* The status field indicates if the device is enabled when the status
539539
* is 'okay'. Otherwise the device driver will be disabled.
540540
*
541+
* @devdata: struct nx842_devdata to use for dev_info
541542
* @prop: struct property point containing the maxsyncop for the update
542543
*
543544
* Returns:
544545
* 0 - Device is available
545546
* -ENODEV - Device is not available
546547
*/
547-
static int nx842_OF_upd_status(struct property *prop)
548+
static int nx842_OF_upd_status(struct nx842_devdata *devdata,
549+
struct property *prop)
548550
{
549551
const char *status = (const char *)prop->value;
550552

@@ -757,7 +759,7 @@ static int nx842_OF_upd(struct property *new_prop)
757759
goto out;
758760

759761
/* Perform property updates */
760-
ret = nx842_OF_upd_status(status);
762+
ret = nx842_OF_upd_status(new_devdata, status);
761763
if (ret)
762764
goto error_out;
763765

0 commit comments

Comments
 (0)