]> 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)
commitbf1a0e5931cbe4842f8716302bf0d1d7e2a7adbb
tree7238f444787986920136c1a5364c7db82617d179
parent66be8e759c99fc99dd930b7ab575681de564c9f9
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