- fw-memory-leakages-in-driver-acpi-videoc.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     memory leakages in driver/acpi/video.c

has been removed from the -mm tree.  Its filename is

     fw-memory-leakages-in-driver-acpi-videoc.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.


From: "Yu, Luming" <luming.yu@xxxxxxxxx>

acpi_video_bus_get_one_device() and other functions in driver/acpi/video.c do
not release allocated memory on remove and on the error path.

Signed-off-by: "Yu, Luming" <luming.yu@xxxxxxxxx>
Signed-off-by: Vasily Averin <vvs@xxxxx>
Cc: "Brown, Len" <len.brown@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/acpi/video.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff -puN drivers/acpi/video.c~fw-memory-leakages-in-driver-acpi-videoc drivers/acpi/video.c
--- devel/drivers/acpi/video.c~fw-memory-leakages-in-driver-acpi-videoc	2006-05-11 14:37:05.000000000 -0700
+++ devel-akpm/drivers/acpi/video.c	2006-05-11 14:37:38.000000000 -0700
@@ -1229,7 +1229,7 @@ acpi_video_bus_get_one_device(struct acp
 			      struct acpi_video_bus *video)
 {
 	unsigned long device_id;
-	int status, result;
+	int status;
 	struct acpi_video_device *data;
 
 	if (!device || !video)
@@ -1277,8 +1277,11 @@ acpi_video_bus_get_one_device(struct acp
 						     acpi_video_device_notify,
 						     data);
 		if (ACPI_FAILURE(status)) {
-			result = -ENODEV;
-			goto end;
+			if(data->brightness)
+				kfree(data->brightness->levels);
+			kfree(data->brightness);
+			kfree(data);
+			return_VALUE(-ENODEV);
 		}
 
 		down(&video->sem);
@@ -1290,7 +1293,6 @@ acpi_video_bus_get_one_device(struct acp
 		return 0;
 	}
 
-      end:
 	return -ENOENT;
 }
 
@@ -1558,8 +1560,9 @@ static int acpi_video_bus_put_devices(st
 			printk(KERN_WARNING PREFIX
 			       "hhuuhhuu bug in acpi video driver.\n");
 
+		if (data->brightness);
+			kfree(data->brightness->levels);
 		kfree(data->brightness);
-
 		kfree(data);
 	}
 
@@ -1690,6 +1693,10 @@ static int acpi_video_bus_add(struct acp
 					     ACPI_DEVICE_NOTIFY,
 					     acpi_video_bus_notify, video);
 	if (ACPI_FAILURE(status)) {
+		acpi_video_bus_stop_devices(video);
+		acpi_video_bus_put_devices(video);
+		kfree(video->attached_array);
+		acpi_video_bus_remove_fs(device);
 		result = -ENODEV;
 		goto end;
 	}
@@ -1701,10 +1708,8 @@ static int acpi_video_bus_add(struct acp
 	       video->flags.post ? "yes" : "no");
 
       end:
-	if (result) {
-		acpi_video_bus_remove_fs(device);
+	if (result)
 		kfree(video);
-	}
 
 	return result;
 }
_

Patches currently in -mm which might be from luming.yu@xxxxxxxxx are

git-acpi.patch
reverse-pci-config-space-restore-order.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux