summaryrefslogtreecommitdiffstats
path: root/commands/loadxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/loadxy.c')
-rw-r--r--commands/loadxy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/loadxy.c b/commands/loadxy.c
index df14043d69..1e65cb6221 100644
--- a/commands/loadxy.c
+++ b/commands/loadxy.c
@@ -43,10 +43,10 @@
static int console_change_speed(struct console_device *cdev, int baudrate)
{
int current_baudrate;
+ const char *bstr;
- current_baudrate =
- (int)simple_strtoul(dev_get_param(&cdev->class_dev,
- "baudrate"), NULL, 10);
+ bstr = dev_get_param(&cdev->class_dev, "baudrate");
+ current_baudrate = bstr ? (int)simple_strtoul(bstr, NULL, 10) : 0;
if (baudrate && baudrate != current_baudrate) {
printf("## Switch baudrate from %d to %d bps and press ENTER ...\n",
current_baudrate, baudrate);