PCI/MSI: Check kmalloc() return value, fix leak of name
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2014 19:30:37 +0000 (11:30 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 4 Feb 2014 06:08:48 +0000 (22:08 -0800)
commitb3bac8e57c82e8d3e05f4abcb18c4f0a40656655
tree005a6e53577aa8cf549e6b8a26676869cd60bea9
parent38dbfb59d1175ef458d006556061adeaa8751b72
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: 1c51b50c2995 ("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