Skip to content

Commit

Permalink
libceph: do not dereference a NULL bio pointer
Browse files Browse the repository at this point in the history
Commit f38a518 ("ceph: Convert to immutable biovecs") introduced
a NULL pointer dereference, which broke rbd in -rc1.  Fix it.

Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Ilya Dryomov authored and Sage Weil committed Feb 7, 2014
1 parent ff513ac commit 0ec1d15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,13 @@ static bool ceph_msg_data_bio_advance(struct ceph_msg_data_cursor *cursor,

if (!cursor->bvec_iter.bi_size) {
bio = bio->bi_next;
cursor->bvec_iter = bio->bi_iter;
cursor->bio = bio;
if (bio)
cursor->bvec_iter = bio->bi_iter;
else
memset(&cursor->bvec_iter, 0,
sizeof(cursor->bvec_iter));
}
cursor->bio = bio;

if (!cursor->last_piece) {
BUG_ON(!cursor->resid);
Expand Down

0 comments on commit 0ec1d15

Please sign in to comment.