Commit 9d2b064c authored by Abylay Ospan's avatar Abylay Ospan Committed by Mauro Carvalho Chehab

[media] netup_unidvb: fix potential crash when spi is NULL

Signed-off-by: default avatarAbylay Ospan <aospan@netup.ru>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 47810b43
...@@ -80,11 +80,9 @@ irqreturn_t netup_spi_interrupt(struct netup_spi *spi) ...@@ -80,11 +80,9 @@ irqreturn_t netup_spi_interrupt(struct netup_spi *spi)
u16 reg; u16 reg;
unsigned long flags; unsigned long flags;
if (!spi) { if (!spi)
dev_dbg(&spi->master->dev,
"%s(): SPI not initialized\n", __func__);
return IRQ_NONE; return IRQ_NONE;
}
spin_lock_irqsave(&spi->lock, flags); spin_lock_irqsave(&spi->lock, flags);
reg = readw(&spi->regs->control_stat); reg = readw(&spi->regs->control_stat);
if (!(reg & NETUP_SPI_CTRL_IRQ)) { if (!(reg & NETUP_SPI_CTRL_IRQ)) {
...@@ -234,11 +232,9 @@ void netup_spi_release(struct netup_unidvb_dev *ndev) ...@@ -234,11 +232,9 @@ void netup_spi_release(struct netup_unidvb_dev *ndev)
unsigned long flags; unsigned long flags;
struct netup_spi *spi = ndev->spi; struct netup_spi *spi = ndev->spi;
if (!spi) { if (!spi)
dev_dbg(&spi->master->dev,
"%s(): SPI not initialized\n", __func__);
return; return;
}
spin_lock_irqsave(&spi->lock, flags); spin_lock_irqsave(&spi->lock, flags);
reg = readw(&spi->regs->control_stat); reg = readw(&spi->regs->control_stat);
writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat); writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment