CRISv32: Fix potential null reference in cryptocop driver.
authorJesper Nilsson <jesper.nilsson@axis.com>
Thu, 11 Jun 2009 17:09:00 +0000 (19:09 +0200)
committerJesper Nilsson <jesper.nilsson@axis.com>
Thu, 11 Jun 2009 17:09:00 +0000 (19:09 +0200)
commit91a120d03fd901fc8b95e85af7903358c5862d65
treee2ca1d2bedaf65fdaa41a8266fedff9ffe47de53
parent7f2ff23db1de53ea8695bb4a7c1cfab88886e3fd
CRISv32: Fix potential null reference in cryptocop driver.

The code didn't test the pointer to the newly allocated
memory, but a parameter sent in as value.
Since the input parameter was most often set, the code
would have used a null pointer if the kmalloc failed.
If the input parameter was not set, the code would
leak the allocated buffer.

http://bugzilla.kernel.org/show_bug.cgi?id=11363

Reported-by: Daniel Marjamäki <danielm77@spray.se>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
arch/cris/arch-v32/drivers/cryptocop.c