staging: nvec: potential NULL dereference on error path

We assume nvec->rx can be NULL earlier so I have added a check here as
well.

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 2013-11-07 14:25:32 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель cb4855b49d
Коммит 6330f9cf34
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
dev_err(nvec->dev, dev_err(nvec->dev,
"RX buffer overflow on %p: " "RX buffer overflow on %p: "
"Trying to write byte %u of %u\n", "Trying to write byte %u of %u\n",
nvec->rx, nvec->rx->pos, NVEC_MSG_SIZE); nvec->rx, nvec->rx ? nvec->rx->pos : 0,
NVEC_MSG_SIZE);
break; break;
default: default:
nvec->state = 0; nvec->state = 0;