]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: Fix incorrect use of cpumask_t
authorMingzhe Zou <mingzhe.zou@easystack.cn>
Mon, 16 May 2022 05:47:21 +0000 (13:47 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 18 May 2022 01:42:23 +0000 (21:42 -0400)
commit08d94be07c60e001cfdaf4588d3ec7465afa17a5
treee8e2cf0f0e1633fd4e43e7e9d83e788eeccfcf6f
parentc1a6f3ba25cb8b7aa39a4e4b7b9d06f4691726a8
scsi: target: Fix incorrect use of cpumask_t

In commit 80367d583e32, I used 'cpumask_t' incorrectly:

    void iscsit_thread_get_cpumask(struct iscsi_conn *conn)
    {
            int ord, cpu;
            cpumask_t conn_allowed_cpumask;
            ......
    }

    static ssize_t lio_target_wwn_cpus_allowed_list_store(
                   struct config_item *item, const char *page, size_t count)
    {
            int ret;
            char *orig;
            cpumask_t new_allowed_cpumask;
            ......
    }

The correct pattern should be as follows:

    cpumask_var_t mask;

    if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
            return -ENOMEM;
    ... use 'mask' here ...
    free_cpumask_var(mask);

Link: https://lore.kernel.org/r/20220516054721.1548-1-mingzhe.zou@easystack.cn
Fixes: 80367d583e32 ("scsi: target: Add iscsi/cpus_allowed_list in configfs")
Reported-by: Test Bot <zgrieee@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Mingzhe Zou <mingzhe.zou@easystack.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_configfs.c