]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: unionxx5: fix memory leak during subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 15 Apr 2013 17:19:07 +0000 (10:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2013 17:13:01 +0000 (10:13 -0700)
commit75633693a3d9d721fc5b02ff344db531f39ad30c
treed058a1001785e9154991ace8fa07e45721a8c608
parent6bce14abec5971591023d79698f9e86ccc8f5d9a
staging: comedi: unionxx5: fix memory leak during subdevice init

In the subdevice init during the attach of this driver, private data
is allocated for each subdevice. The pointer to this data is then
saved in the subdevice 's->private' so it can be free'ed during the
detach.

In __unioxx5_subdev_init() an error path exists that can happen before
the allocated pointer is saved in s->private. Make sure the allocated
memory is free'ed before returning the error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/unioxx5.c