[PATCH 09/13] Fix malloc handling in dlink.c

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

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 dlink.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlink.c b/dlink.c
index d734281..168ca2f 100644
--- a/dlink.c
+++ b/dlink.c
@@ -15,8 +15,10 @@ void *dl_head()
 {
     void *h;
     h = dl_alloc(0);
-    dl_next(h) = h;
-    dl_prev(h) = h;
+    if (h) {
+	    dl_next(h) = h;
+	    dl_prev(h) = h;
+    }
     return h;
 }
 
-- 
1.7.6.4

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


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux