On Mon, Dec 9, 2019 at 6:42 PM Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx> wrote: > > In raid1_sync_request func, rdev should be checked whether it is null > before reference. > > -- > V1->V2: remove Fixes tag suggested by Guoqing Jiang For future patches, please put "v1 -> v2" after the SoB tag. And add "---" before it. Then, this part will be removed during git-am. Applied with minor change. Thanks, Song > > Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx> > --- > drivers/md/raid1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c > index a409ab6f30bc..0dea35052efe 100644 > --- a/drivers/md/raid1.c > +++ b/drivers/md/raid1.c > @@ -2782,7 +2782,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, > write_targets++; > } > } > - if (bio->bi_end_io) { > + if (rdev != NULL && bio->bi_end_io) { > atomic_inc(&rdev->nr_pending); > bio->bi_iter.bi_sector = sector_nr + rdev->data_offset; > bio_set_dev(bio, rdev->bdev); > -- > 2.24.0.windows.2 > >