Commit e8a308af authored by Kiran Padwal's avatar Kiran Padwal Committed by David S. Miller

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: default avatarKiran Padwal <kiran.padwal@smartplayin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7744b5f3
...@@ -78,6 +78,9 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i ...@@ -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), priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
GFP_KERNEL); GFP_KERNEL);
if (!priv)
return -ENOMEM;
ci = (struct com20020_pci_card_info *)id->driver_data; ci = (struct com20020_pci_card_info *)id->driver_data;
priv->ci = ci; priv->ci = ci;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment