From af5c95317c8882f9ca1a0a4516728b0efc782f94 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 3 Dec 2012 09:43:26 +0100 Subject: [PATCH] light: fix potential NULL ptr deref --- sy_old/mars_light.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sy_old/mars_light.c b/sy_old/mars_light.c index 7e3252b8..b3ffb0d9 100644 --- a/sy_old/mars_light.c +++ b/sy_old/mars_light.c @@ -1916,6 +1916,8 @@ int make_log_step(void *buf, struct mars_dent *dent) CHECK_PTR(parent, err); rot = parent->d_private; + if (!rot) + goto err; CHECK_PTR(rot, err); status = 0; @@ -2493,6 +2495,8 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent) CHECK_PTR(parent, err); rot = parent->d_private; + if (!rot) + goto err; CHECK_PTR(rot, err); trans_brick = rot->trans_brick; status = 0; @@ -2624,6 +2628,8 @@ int make_primary(void *buf, struct mars_dent *dent) parent = dent->d_parent; CHECK_PTR(parent, done); rot = parent->d_private; + if (!rot) + goto done; CHECK_PTR(rot, done); rot->todo_primary =