All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] slimbus: patches(set 1) for 5.4
@ 2019-08-18  9:39 Srinivas Kandagatla
  2019-08-18  9:39 ` [PATCH 1/2] slimbus: qcom-ngd-ctrl: Add of_node_put() before return Srinivas Kandagatla
  2019-08-18  9:39 ` [PATCH 2/2] slimbus: fix slim_tid_txn() Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-08-18  9:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla

Hi Greg,

Here are some slimbus patches for 5.4 which includes:
Two fixes, one to fix the dt node refcount and other
is to address a coccicheck.

Can you please queue them up for 5.4.

Thanks,
srini

Nishka Dasgupta (1):
  slimbus: qcom-ngd-ctrl: Add of_node_put() before return

Srinivas Kandagatla (1):
  slimbus: fix slim_tid_txn()

 drivers/slimbus/qcom-ngd-ctrl.c | 5 ++++-
 drivers/slimbus/slimbus.h       | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.21.0


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

* [PATCH 1/2] slimbus: qcom-ngd-ctrl: Add of_node_put() before return
  2019-08-18  9:39 [PATCH 0/2] slimbus: patches(set 1) for 5.4 Srinivas Kandagatla
@ 2019-08-18  9:39 ` Srinivas Kandagatla
  2019-08-18  9:39 ` [PATCH 2/2] slimbus: fix slim_tid_txn() Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-08-18  9:39 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Nishka Dasgupta, Bjorn Andersson, Srinivas Kandagatla

From: Nishka Dasgupta <nishkadg.linux@gmail.com>

Each iteration of for_each_available_child_of_node puts the previous
node, but in the case of a return from the middle of the loop, there is
no put, thus causing a memory leak. Hence add an of_node_put before the
return in two places.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index f3585777324c..29fbab55c3b3 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1338,12 +1338,15 @@ static int of_qcom_slim_ngd_register(struct device *parent,
 			continue;
 
 		ngd = kzalloc(sizeof(*ngd), GFP_KERNEL);
-		if (!ngd)
+		if (!ngd) {
+			of_node_put(node);
 			return -ENOMEM;
+		}
 
 		ngd->pdev = platform_device_alloc(QCOM_SLIM_NGD_DRV_NAME, id);
 		if (!ngd->pdev) {
 			kfree(ngd);
+			of_node_put(node);
 			return -ENOMEM;
 		}
 		ngd->id = id;
-- 
2.21.0


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

* [PATCH 2/2] slimbus: fix slim_tid_txn()
  2019-08-18  9:39 [PATCH 0/2] slimbus: patches(set 1) for 5.4 Srinivas Kandagatla
  2019-08-18  9:39 ` [PATCH 1/2] slimbus: qcom-ngd-ctrl: Add of_node_put() before return Srinivas Kandagatla
@ 2019-08-18  9:39 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-08-18  9:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla, Hariprasad Kelam

fix below issue reported by coccicheck
./drivers/slimbus/slimbus.h:440:3-46: duplicated argument to && or ||

Looks like this was a typo, SLIM_MSG_MC_REQUEST_CHANGE_VALUE is command
which requires transaction ID, so fix it, this also fix the warning.

Reported-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/slimbus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h
index 9be41089edde..b2f013bfe42e 100644
--- a/drivers/slimbus/slimbus.h
+++ b/drivers/slimbus/slimbus.h
@@ -439,7 +439,7 @@ static inline bool slim_tid_txn(u8 mt, u8 mc)
 		(mc == SLIM_MSG_MC_REQUEST_INFORMATION ||
 		 mc == SLIM_MSG_MC_REQUEST_CLEAR_INFORMATION ||
 		 mc == SLIM_MSG_MC_REQUEST_VALUE ||
-		 mc == SLIM_MSG_MC_REQUEST_CLEAR_INFORMATION));
+		 mc == SLIM_MSG_MC_REQUEST_CHANGE_VALUE));
 }
 
 static inline bool slim_ec_txn(u8 mt, u8 mc)
-- 
2.21.0


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

end of thread, other threads:[~2019-08-18  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-18  9:39 [PATCH 0/2] slimbus: patches(set 1) for 5.4 Srinivas Kandagatla
2019-08-18  9:39 ` [PATCH 1/2] slimbus: qcom-ngd-ctrl: Add of_node_put() before return Srinivas Kandagatla
2019-08-18  9:39 ` [PATCH 2/2] slimbus: fix slim_tid_txn() Srinivas Kandagatla

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.