hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/base/regmap/regcache.c
....@@ -343,6 +343,9 @@
343343 const char *name;
344344 bool bypass;
345345
346
+ if (WARN_ON(map->cache_type == REGCACHE_NONE))
347
+ return -EINVAL;
348
+
346349 BUG_ON(!map->cache_ops);
347350
348351 map->lock(map->lock_arg);
....@@ -412,6 +415,9 @@
412415 const char *name;
413416 bool bypass;
414417
418
+ if (WARN_ON(map->cache_type == REGCACHE_NONE))
419
+ return -EINVAL;
420
+
415421 BUG_ON(!map->cache_ops);
416422
417423 map->lock(map->lock_arg);