hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
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);