Skip to contentSkip to conversation

staging: comedi: fix memory leak

PATCH In review Levente Kurusa 2 participants 4 messages Mar 14, 2014 – Mar 15, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: fix memory leak

Call kfree() on bdev. The variable is otherwise leaked.

---
 drivers/staging/comedi/drivers/comedi_bond.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/comedi/drivers/comedi_bond.c +1 -0
index 51a59e5..406aedb 100644
@@ -254,6 +254,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
 			if (!devs) {
 				dev_err(dev->class_dev,
 					"Could not allocate memory. Out of memory?\n");
+				kfree(bdev);
 				return -ENOMEM;
 			}
 			devpriv->devs = devs;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 24 lines · Levente Kurusa

Call kfree() on bdev. The variable is otherwise leaked.

---
drivers/staging/comedi/drivers/comedi_bond.c | 1 +

1 file changed, 1 insertion(+)
drivers/staging/comedi/drivers/comedi_bond.c +1 -0
index 51a59e5..406aedb 100644
@@ -254,6 +254,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
            if (!devs) {
                dev_err(dev->class_dev,
                    "Could not allocate memory. Out of memory?\n");
+                kfree(bdev);
                return -ENOMEM;
            }
            devpriv->devs = devs;
Signature · 1 line
1.8.3.1

Levente,

This change has already been made in staging-next (by me, actually :) ).  In order to avoid re-doing work which has already been done, please make sure to base all of your patches off of linux-next (or for staging, staging-next).

Thanks,
Chase

#2 lore raw
Quoted 9 lines · Chase Southwood
Quoted 7 lines · Levente Kurusa

Call kfree() on bdev. The variable is otherwise leaked.

Quoted 9 lines

Levente,

This change has already been made in staging-next (by me, actually :) ). In order to avoid re-doing work which has already been done, please make sure to base all of your patches off of linux-next (or for staging, staging-next).

Thanks,
Chase

Ah, yes I see now. I wonder how it didn't reach my tree. Anyways, thanks for the heads up!

Signature · 2 lines
Regards,
Levente Kurusa
#3 lore raw
Quoted 18 lines · Levente Kurusa
Quoted 17 lines · Chase Southwood
Quoted 7 lines · Levente Kurusa


Call kfree() on bdev. The variable is otherwise leaked.

Levente,

This change has already been made in staging-next (by me, actually :) ).  In order to avoid re-doing work which has already been done, please make sure to base all of your patches off of linux-next (or for staging, staging-next).

Quoted 10 lines
Quoted 3 lines

Thanks,
Chase

Ah, yes I see now. I wonder how it didn't reach my tree. Anyways, thanks for the heads up!

Signature · 2 lines
Regards,
Levente Kurusa

No problem, just wanted to make sure you were working from an up-to-date tree :)

Thanks,
Chase