Unverified Commit abe00c72 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4709 mtd: Fix gluebi NULL pointer dereference caused by ftl notifier

parents fe638d10 4d81896c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ static void blktrans_notify_add(struct mtd_info *mtd)
{
	struct mtd_blktrans_ops *tr;

	if (mtd->type == MTD_ABSENT)
	if (mtd->type == MTD_ABSENT || mtd->type == MTD_UBIVOLUME)
		return;

	list_for_each_entry(tr, &blktrans_majors, list)
@@ -503,7 +503,7 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
	mutex_lock(&mtd_table_mutex);
	list_add(&tr->list, &blktrans_majors);
	mtd_for_each_device(mtd)
		if (mtd->type != MTD_ABSENT)
		if (mtd->type != MTD_ABSENT && mtd->type != MTD_UBIVOLUME)
			tr->add_mtd(tr, mtd);
	mutex_unlock(&mtd_table_mutex);
	return 0;