kernel: fix possible mtd NULL pointer dereference

Fixes: 1a9ee36734 ("kernel: backport mtd dynamic partition patch")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
Rafał Miłecki
2022-10-04 12:04:37 +02:00
parent 45109f69a6
commit a5265497a4
7 changed files with 65 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
#include "mtdcore.h"
@@ -1073,6 +1074,8 @@ int mtd_device_parse_register(struct mtd
@@ -1075,6 +1076,8 @@ int mtd_device_parse_register(struct mtd
ret = mtd_otp_nvmem_add(mtd);

View File

@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
#include <linux/nvmem-provider.h>
#include <linux/mtd/mtd.h>
@@ -768,6 +769,16 @@ int add_mtd_device(struct mtd_info *mtd)
@@ -770,6 +771,16 @@ int add_mtd_device(struct mtd_info *mtd)
of this try_ nonsense, and no bitching about it
either. :) */
__module_get(THIS_MODULE);