aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet
diff options
context:
space:
mode:
authorKiran Padwal <kiran.padwal@smartplayin.com>2015-02-05 17:01:37 +0530
committerDavid S. Miller <davem@davemloft.net>2015-02-05 15:53:34 -0800
commite8a308affcd79d95dad111f7872e43e9f73abb3b (patch)
treeba1adb78dc72aa84b5d3fa807df50f26926d430f /drivers/net/arcnet
parentpktgen: fix UDP checksum computation (diff)
downloadlinux-dev-e8a308affcd79d95dad111f7872e43e9f73abb3b.tar.xz
linux-dev-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')
-rw-r--r--drivers/net/arcnet/com20020-pci.c3
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;