]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()
authorChristian Engelmayer <cengelma@gmx.at>
Wed, 7 May 2014 19:36:48 +0000 (21:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 16:57:14 +0000 (01:57 +0900)
commit51b4706f8ebabad28497c3ba1d6941233ec140b2
tree7238f444787986920136c1a5364c7db82617d179
parent05011190785dbb2435c194993af2906d0c4d2daa
staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()

Fix a potential leak in the error path of r871x_wx_set_enc_ext(). In case the
requested algorithm is not supported by the driver, the function returns
without freeing the already allocated 'param' struct. Move the input
verification to the beginning of the function so that the direct return is
safe. Detected by Coverity - CID 144373.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_ioctl_linux.c