Staging: wilc1000: unlock on error in init_chip()

When there is an error in init_bus() then we need to call release_bus()
before we return.

Fixes: c5c77ba18e ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2018-12-21 12:12:02 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель fe2570fbf3
Коммит 0a9019cc8a
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -1252,21 +1252,22 @@ static u32 init_chip(struct net_device *dev)
ret = wilc->hif_func->hif_read_reg(wilc, 0x1118, &reg);
if (!ret) {
netdev_err(dev, "fail read reg 0x1118\n");
return ret;
goto release;
}
reg |= BIT(0);
ret = wilc->hif_func->hif_write_reg(wilc, 0x1118, reg);
if (!ret) {
netdev_err(dev, "fail write reg 0x1118\n");
return ret;
goto release;
}
ret = wilc->hif_func->hif_write_reg(wilc, 0xc0000, 0x71);
if (!ret) {
netdev_err(dev, "fail write reg 0xc0000\n");
return ret;
goto release;
}
}
release:
release_bus(wilc, WILC_BUS_RELEASE_ONLY);
return ret;