aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKiran Padwal <kiran.padwal@smartplayin.com>2015-02-05 06:31:37 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 18:53:34 -0500
commite8a308affcd79d95dad111f7872e43e9f73abb3b (patch)
treeba1adb78dc72aa84b5d3fa807df50f26926d430f /drivers/net
parent7744b5f3693cc06695cb9d6667671c790282730f (diff)
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')
-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
78 78
79 priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv), 79 priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
80 GFP_KERNEL); 80 GFP_KERNEL);
81 if (!priv)
82 return -ENOMEM;
83
81 ci = (struct com20020_pci_card_info *)id->driver_data; 84 ci = (struct com20020_pci_card_info *)id->driver_data;
82 priv->ci = ci; 85 priv->ci = ci;
83 86