You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ko...@apache.org on 2021/02/25 12:07:54 UTC

[mynewt-core] branch master updated: sensor_shell: return error in sensor_cmd_notify if no sensor found

This is an automated email from the ASF dual-hosted git repository.

kopyscinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ea6df6  sensor_shell: return error in sensor_cmd_notify if no sensor found
9ea6df6 is described below

commit 9ea6df6c7cdf0cb137185cddd558bfabdd02e092
Author: Krzysztof Kopyściński <kr...@codecoup.pl>
AuthorDate: Thu Feb 25 10:54:26 2021 +0100

    sensor_shell: return error in sensor_cmd_notify if no sensor found
---
 hw/sensor/src/sensor_shell.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/sensor/src/sensor_shell.c b/hw/sensor/src/sensor_shell.c
index 0f7f063..4dcee58 100644
--- a/hw/sensor/src/sensor_shell.c
+++ b/hw/sensor/src/sensor_shell.c
@@ -789,6 +789,8 @@ sensor_cmd_notify(char *name, bool on, char *type_string)
     sensor = sensor_mgr_find_next_bydevname(name, NULL);
     if (!sensor) {
         console_printf("Sensor %s not found!\n", name);
+        rc = SYS_EINVAL;
+        goto done;
     }
 
     if (!strcmp(type_string, "single")) {