]> git.baikalelectronics.ru Git - kernel.git/commit
Input: adxl34x - fix leak and use after free
authorDan Carpenter <error27@gmail.com>
Fri, 23 Jul 2010 06:38:45 +0000 (23:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 23 Jul 2010 06:39:16 +0000 (23:39 -0700)
commit85784737c7c4d718223bb6e5782aa7df79e52215
tree9c663e053d1a9c35d260de1b00a141e6b9dd073f
parent25d322a9b6742ebb82e09840fac4a7f65a883457
Input: adxl34x - fix leak and use after free

These are a couple smatch issues.  In the original code, if only one of
the allocation fails we leak the other variable so we should goto
out_free_mem.

Also there was a use after free if debugging was enabled and so I moved
the kfree() down a line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/misc/adxl34x.c