diff options
author | Ilya Dryomov <ilya.dryomov@inktank.com> | 2014-02-05 08:19:55 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2014-02-07 14:37:07 -0500 |
commit | 0ec1d15ec6ed513ab2cc86c67d94761d71228a32 (patch) | |
tree | cc8da7ba4af20ea86d1dccdbedcffeb19ddd2059 /net/ceph/messenger.c | |
parent | ff513ace9b772e75e337f8e058cc7f12816843fe (diff) |
libceph: do not dereference a NULL bio pointer
Commit f38a5181d9f3 ("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>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 0e478a0f4204..30efc5c18622 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -840,9 +840,13 @@ static bool ceph_msg_data_bio_advance(struct ceph_msg_data_cursor *cursor, | |||
840 | 840 | ||
841 | if (!cursor->bvec_iter.bi_size) { | 841 | if (!cursor->bvec_iter.bi_size) { |
842 | bio = bio->bi_next; | 842 | bio = bio->bi_next; |
843 | cursor->bvec_iter = bio->bi_iter; | 843 | cursor->bio = bio; |
844 | if (bio) | ||
845 | cursor->bvec_iter = bio->bi_iter; | ||
846 | else | ||
847 | memset(&cursor->bvec_iter, 0, | ||
848 | sizeof(cursor->bvec_iter)); | ||
844 | } | 849 | } |
845 | cursor->bio = bio; | ||
846 | 850 | ||
847 | if (!cursor->last_piece) { | 851 | if (!cursor->last_piece) { |
848 | BUG_ON(!cursor->resid); | 852 | BUG_ON(!cursor->resid); |