Skip to content

Commit

Permalink
staging: nvec: Do not print free message for tx_scratch
Browse files Browse the repository at this point in the history
The scratch area is not part of the pool and thus gets
no allocation message. Printing a free message would
be confusing, and the pointer subtraction would be
undefined behavior.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Julian Andres Klode authored and Greg Kroah-Hartman committed Sep 30, 2011
1 parent 0cab4cb commit 7b77065
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 @@ -110,7 +110,8 @@ static struct nvec_msg *nvec_msg_alloc(struct nvec_chip *nvec)

static void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg)
{
dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool);
if (msg != &nvec->tx_scratch)
dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool);
atomic_set(&msg->used, 0);
}

Expand Down

0 comments on commit 7b77065

Please sign in to comment.