Skip to content

Commit

Permalink
Merge tag 'md-fixes-2023-03-29' of https://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/song/md into block-6.3

Pull MD fix from Song.

* tag 'md-fixes-2023-03-29' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
  md: fix regression for null-ptr-deference in __md_stop()
  • Loading branch information
Jens Axboe committed Mar 31, 2023
2 parents 1a06ed2 + 433279b commit 24ab70d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -6260,7 +6260,6 @@ static void __md_stop(struct mddev *mddev)
module_put(pers->owner);
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);

percpu_ref_exit(&mddev->writes_pending);
percpu_ref_exit(&mddev->active_io);
bioset_exit(&mddev->bio_set);
bioset_exit(&mddev->sync_set);
Expand All @@ -6273,6 +6272,7 @@ void md_stop(struct mddev *mddev)
*/
__md_stop_writes(mddev);
__md_stop(mddev);
percpu_ref_exit(&mddev->writes_pending);
}

EXPORT_SYMBOL_GPL(md_stop);
Expand Down Expand Up @@ -7843,6 +7843,7 @@ static void md_free_disk(struct gendisk *disk)
{
struct mddev *mddev = disk->private_data;

percpu_ref_exit(&mddev->writes_pending);
mddev_free(mddev);
}

Expand Down

0 comments on commit 24ab70d

Please sign in to comment.