selftests: devlink_lib: Fix bouncing of netdevsim DEVLINK_DEV
[linux-2.6-microblaze.git] / tools / testing / selftests / net / forwarding / devlink_lib.sh
index c19e001..39fb9b8 100644 (file)
@@ -18,7 +18,7 @@ if [[ ! -v DEVLINK_DEV ]]; then
 
        DEVLINK_VIDDID=$(lspci -s $(echo $DEVLINK_DEV | cut -d"/" -f2) \
                         -n | cut -d" " -f3)
-else
+elif [[ ! -z "$DEVLINK_DEV" ]]; then
        devlink dev show $DEVLINK_DEV &> /dev/null
        if [ $? -ne 0 ]; then
                echo "SKIP: devlink device \"$DEVLINK_DEV\" not found"