diff options
author | Kiran Padwal <kiran.padwal@smartplayin.com> | 2015-02-05 12:31:37 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-06 00:53:34 +0100 |
commit | e8a308affcd79d95dad111f7872e43e9f73abb3b (patch) | |
tree | ba1adb78dc72aa84b5d3fa807df50f26926d430f /drivers/net/arcnet/com20020-pci.c | |
parent | pktgen: fix UDP checksum computation (diff) | |
download | linux-e8a308affcd79d95dad111f7872e43e9f73abb3b.tar.xz linux-e8a308affcd79d95dad111f7872e43e9f73abb3b.zip |
ARCNET: Add missing error check for devm_kzalloc
This patch add a missing check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.
Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/arcnet/com20020-pci.c')
-rw-r--r-- | drivers/net/arcnet/com20020-pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index 6c99ff0b0bdd..945f532078e9 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c @@ -78,6 +78,9 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + ci = (struct com20020_pci_card_info *)id->driver_data; priv->ci = ci; |