light: fix potential NULL ptr deref

This commit is contained in:
Thomas Schoebel-Theuer 2012-12-03 09:43:26 +01:00 committed by Thomas Schoebel-Theuer
parent 3f4e86427d
commit af5c95317c
1 changed files with 6 additions and 0 deletions

View File

@ -1916,6 +1916,8 @@ int make_log_step(void *buf, struct mars_dent *dent)
CHECK_PTR(parent, err); CHECK_PTR(parent, err);
rot = parent->d_private; rot = parent->d_private;
if (!rot)
goto err;
CHECK_PTR(rot, err); CHECK_PTR(rot, err);
status = 0; status = 0;
@ -2493,6 +2495,8 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent)
CHECK_PTR(parent, err); CHECK_PTR(parent, err);
rot = parent->d_private; rot = parent->d_private;
if (!rot)
goto err;
CHECK_PTR(rot, err); CHECK_PTR(rot, err);
trans_brick = rot->trans_brick; trans_brick = rot->trans_brick;
status = 0; status = 0;
@ -2624,6 +2628,8 @@ int make_primary(void *buf, struct mars_dent *dent)
parent = dent->d_parent; parent = dent->d_parent;
CHECK_PTR(parent, done); CHECK_PTR(parent, done);
rot = parent->d_private; rot = parent->d_private;
if (!rot)
goto done;
CHECK_PTR(rot, done); CHECK_PTR(rot, done);
rot->todo_primary = rot->todo_primary =