Commit 1e142b00 authored by Jilay Pandya's avatar Jilay Pandya Committed by Anas Nashif
Browse files

drivers: stepper: shell: fix null pointer check

This commit introduces null pointer check in print_callback

Signed-off-by: default avatarJilay Pandya <jilay.pandya@outlook.com>
parent 195c2c13
Loading
Loading
Loading
Loading
+3 −0
Changes for drivers/stepper/stepper_shell.c: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@ static void print_callback(const struct device *dev, const enum stepper_event ev
			   void *user_data)
{
	const struct shell *sh = user_data;
	if (!sh) {
		return;
	}

	switch (event) {
	case STEPPER_EVENT_STEPS_COMPLETED: