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

[tyndur-devel] [PATCH v2 12/24] ata: Initialize ata_device to 0



* struct ata_device inherits cdi_storage_device or cdi_scsi_device.
  Since this driver does not know all of the fields contained therein
  for sure, the object has to be initialized to 0.

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
Acked-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/cdi/ata/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/cdi/ata/device.c b/src/modules/cdi/ata/device.c
index baedd72..db47832 100644
--- a/src/modules/cdi/ata/device.c
+++ b/src/modules/cdi/ata/device.c
@@ -222,7 +222,7 @@ void ata_init_controller(struct ata_controller* controller)
     // Jetzt werden die einzelnen geraete identifiziert. Hier ist es
     // anscheinend geschickter mit dem Slave zu beginnen.
     for (i = 1; i >= 0; i--) {
-        struct ata_device* dev = malloc(sizeof(*dev));
+        struct ata_device* dev = calloc(1, sizeof(*dev));
         dev->controller = controller;
         dev->id = i;
         dev->partition_list = cdi_list_create();
-- 
2.6.3