Skip to content

Commit

Permalink
staging: nvec: potential NULL dereference on error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 25, 2013
1 parent cb4855b commit 6330f9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6330f9c

Please sign in to comment.