drivers: stepper: shell: fix null pointer check
This commit introduces null pointer check in print_callback Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
parent
195c2c1360
commit
1e142b0001
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue