summaryrefslogtreecommitdiff
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-11-07 14:25:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-25 09:14:29 -0800
commit6330f9cf347849de74899e5fac00bfecd84a6b43 (patch)
tree876904b000ae9519f95c9fb449e4b290c80d1846 /drivers/staging/nvec
parentcb4855b49deb1acce27706ad9509d63c4fe8e988 (diff)
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>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 3066ee2e753b..49ea76b3435d 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
dev_err(nvec->dev,
"RX buffer overflow on %p: "
"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;
default:
nvec->state = 0;