From: Lee Jones <hidden> Date: 2016-03-23 14:45:50
Hi Jassi,
Resending these with patches 1 and 2 merged, as requested.
Kind regards,
Lee
v1 => v2:
- Patch 2 merged into patch
- No functional changes
Lee Jones (5):
ARM: STi: stih407-family: Add nodes for Mailbox
ARM: STi: DT: STiH407: Enable Mailbox testing facility
mailbox: mailbox-test: Use more consistent format for calling
copy_from_user()
mailbox: mailbox-test: Prevent memory leak
mailbox: Stop using ENOSYS for anything other than unimplemented
syscalls
arch/arm/boot/dts/stih407-family.dtsi | 39 +++++++++++++++++++++++++++++++++++
drivers/mailbox/mailbox-test.c | 16 +++++++-------
drivers/mailbox/mailbox.c | 4 ++--
3 files changed, 50 insertions(+), 9 deletions(-)
--
1.9.1
From: Lee Jones <hidden> Date: 2016-03-23 14:45:55
If we set the Signal twice or more, without using it as part of a message,
memory will be re-allocated and the pointer over-written. Prevent this
potential leak by only allocating memory when there isn't any already.
Reported-by: Dan Carpenter <redacted>
Signed-off-by: Lee Jones <redacted>
---
drivers/mailbox/mailbox-test.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
@@ -59,9 +59,12 @@ static ssize_t mbox_test_signal_write(struct file *filp,return-EINVAL;}-tdev->signal=kzalloc(MBOX_MAX_SIG_LEN,GFP_KERNEL);-if(!tdev->signal)-return-ENOMEM;+/* Only allocate memory if we need to */+if(!tdev->signal){+tdev->signal=kzalloc(MBOX_MAX_SIG_LEN,GFP_KERNEL);+if(!tdev->signal)+return-ENOMEM;+}if(copy_from_user(tdev->signal,userbuf,count)){kfree(tdev->signal);
From: Lee Jones <hidden> Date: 2016-03-23 14:45:57
While we're at it, ensure copy-to location is NULL'ed in the error path.
Suggested-by: Dan Carpenter <redacted>
Signed-off-by: Lee Jones <redacted>
---
drivers/mailbox/mailbox-test.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
From: Lee Jones <hidden> Date: 2016-03-23 14:45:59
This patch supplies a Client node to enable the Mailbox testing
facility. It will be used to send and receive messages from any
given co-processor in order to test the STi Mailbox Controller
driver.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
From: Lee Jones <hidden> Date: 2016-03-23 14:46:01
This patch supplies the Mailbox Controller nodes. In order to
request channels, these nodes will be referenced by Mailbox
Client nodes.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
From: Lee Jones <hidden> Date: 2016-03-23 14:46:51
In accordance with e15f431fe2d5 ("errno.h: Improve ENOSYS's comment") and
91c9afaf97ee ("checkpatch.pl: new instances of ENOSYS are errors") we're
converting from the old meaning of: ENOSYS "Function not implemented" to
a more standard EINVAL.
Reported-by: Seraphin Bonnaffe <redacted>
Signed-off-by: Lee Jones <redacted>
---
drivers/mailbox/mailbox.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
This patch supplies a Client node to enable the Mailbox testing
facility. It will be used to send and receive messages from any
given co-processor in order to test the STi Mailbox Controller
driver.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
From: Lee Jones <hidden> Date: 2016-04-12 14:19:35
On Tue, 12 Apr 2016, Sudeep Holla wrote:
Hi Lee,
On 23/03/16 14:43, Lee Jones wrote:
quoted
This patch supplies a Client node to enable the Mailbox testing
facility. It will be used to send and receive messages from any
given co-processor in order to test the STi Mailbox Controller
driver.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
Great spot, thanks. I will fix before sending to Maxime.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
From: Olof Johansson <hidden> Date: 2016-04-13 21:56:57
Hi,
On Wed, Mar 23, 2016 at 7:43 AM, Lee Jones [off-list ref] wrote:
quoted hunk
This patch supplies a Client node to enable the Mailbox testing
facility. It will be used to send and receive messages from any
given co-processor in order to test the STi Mailbox Controller
driver.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
From: Olof Johansson <hidden> Date: 2016-04-13 21:58:14
Hi,
On Wed, Mar 23, 2016 at 7:43 AM, Lee Jones [off-list ref] wrote:
quoted hunk
This patch supplies the Mailbox Controller nodes. In order to
request channels, these nodes will be referenced by Mailbox
Client nodes.
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih407-family.dtsi | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)