net: orinoco: add error handling for failed kmalloc().
[deliverable/linux.git] / drivers / net / wireless / orinoco / main.c
index dd6c64ac406e8f28d87e69d81dff7b4d8171e19c..88e3ad2d1db8dea4d5e2fcdee52285e399644bcd 100644 (file)
@@ -1336,6 +1336,10 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf,
        unsigned long flags;
 
        sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
+       if (!sd) {
+               printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+               return;
+       }
        sd->buf = buf;
        sd->len = len;
        sd->type = type;
@@ -1353,6 +1357,10 @@ static void qabort_scan(struct orinoco_private *priv)
        unsigned long flags;
 
        sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
+       if (!sd) {
+               printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+               return;
+       }
        sd->len = -1; /* Abort */
 
        spin_lock_irqsave(&priv->scan_lock, flags);
This page took 0.02983 seconds and 5 git commands to generate.