]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
padata: fix sysfs store callback check
authorThomas Weißschuh <linux@weissschuh.net>
Fri, 27 Dec 2024 22:32:01 +0000 (23:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:02 +0000 (12:50 +0100)
[ Upstream commit 9ff6e943bce67d125781fe4780a5d6f072dc44c0 ]

padata_sysfs_store() was copied from padata_sysfs_show() but this check
was not adapted. Today there is no attribute which can fail this
check, but if there is one it may as well be correct.

Fixes: 5e017dc3f8bc ("padata: Added sysfs primitives to padata subsystem")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/padata.c

index 39faea30d76a56beefed6de2126a3f5f08d5f52c..a5699c5ba58da43a96a0c61097aa7642a42d694c 100644 (file)
@@ -959,7 +959,7 @@ static ssize_t padata_sysfs_store(struct kobject *kobj, struct attribute *attr,
 
        pinst = kobj2pinst(kobj);
        pentry = attr2pentry(attr);
-       if (pentry->show)
+       if (pentry->store)
                ret = pentry->store(pinst, attr, buf, count);
 
        return ret;