]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/MSI: Check kmalloc() return value, fix leak of name
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 17:47:20 +0000 (10:47 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 13 Feb 2014 17:47:20 +0000 (10:47 -0700)
commitcf03247441f59b46a79419298b7b3c824a3f9530
tree7f5c75e35d58340c5d7fe391752e8ece4543f134
parentaee35207841b260e3171f805aa6942d6b354188a
PCI/MSI: Check kmalloc() return value, fix leak of name

Coverity reported that I forgot to check the return value of kmalloc() when
creating the MSI attribute name, so fix that up and properly free it if
there is an error when allocating the msi_dev_attr variable.

Found by Coverity (CID 1163315 and 1163316).

Fixes: 8407b4418990 ("PCI/MSI: Export MSI mode using attributes, not kobjects")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/msi.c