All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: cache: bail in regmap_async_complete() for bus-less maps
@ 2013-07-04 11:11 Daniel Mack
  2013-07-04 12:54 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Mack @ 2013-07-04 11:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, Daniel Mack, stable, [v3.10 only]

Commit f8bd822cb ("regmap: cache: Factor out block sync") made
regcache_rbtree_sync() call regmap_async_complete(), which in turn does
not check for map->bus before dereferencing it.

This causes a NULL pointer dereference on bus-less maps.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: stable@vger.kernel.org [v3.10 only]
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index a941dcf..d0c81d1 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1717,7 +1717,7 @@ int regmap_async_complete(struct regmap *map)
 	int ret;
 
 	/* Nothing to do with no async support */
-	if (!map->bus->async_write)
+	if (!map->bus || !map->bus->async_write)
 		return 0;
 
 	trace_regmap_async_complete_start(map->dev);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: cache: bail in regmap_async_complete() for bus-less maps
  2013-07-04 11:11 [PATCH] regmap: cache: bail in regmap_async_complete() for bus-less maps Daniel Mack
@ 2013-07-04 12:54 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-07-04 12:54 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

On Thu, Jul 04, 2013 at 01:11:03PM +0200, Daniel Mack wrote:
> Commit f8bd822cb ("regmap: cache: Factor out block sync") made
> regcache_rbtree_sync() call regmap_async_complete(), which in turn does
> not check for map->bus before dereferencing it.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-04 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 11:11 [PATCH] regmap: cache: bail in regmap_async_complete() for bus-less maps Daniel Mack
2013-07-04 12:54 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.