misc: microchip: pci1xxxx: Fix missing spin_lock_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 7 Sep 2022 14:58:05 +0000 (14:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Sep 2022 08:03:13 +0000 (10:03 +0200)
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220907145808.1789249-2-weiyongjun@huaweicloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c

index 230503c..47e6e87 100644 (file)
@@ -383,6 +383,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device *aux_dev,
        if (!priv)
                return -ENOMEM;
 
+       spin_lock_init(&priv->lock);
        priv->aux_dev = aux_dev;
 
        if (!devm_request_mem_region(&aux_dev->dev, pdata->region_start, 0x800, aux_dev->name))