[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1436923740-12705-1-git-send-email-yamada.masahiro@socionext.com>
Date: Wed, 15 Jul 2015 10:29:00 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Tejun Heo <tj@...nel.org>, stable@...r.kernel.org,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] devres: fix devres_get()
Currently, devres_get() passes devres_free() the pointer to devres,
but devres_free() should be given with the pointer to resource data.
Fixes: 9ac7849e35f7 ("devres: device resource management")
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
Acked-by: Tejun Heo <tj@...nel.org>
---
Changes in v2:
- Fix "Fixes: " tag format ("Fixes: commit ... -> Fixes: ...)
- Add Tejun's Acked-by
- Cc stable@...r.kernel.org
drivers/base/devres.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index c8a53d1..8754646 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -297,10 +297,10 @@ void * devres_get(struct device *dev, void *new_res,
if (!dr) {
add_dr(dev, &new_dr->node);
dr = new_dr;
- new_dr = NULL;
+ new_res = NULL;
}
spin_unlock_irqrestore(&dev->devres_lock, flags);
- devres_free(new_dr);
+ devres_free(new_res);
return dr->data;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists