mei: hbm: drop BUG() from the hbm handler
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 6 Nov 2018 10:04:38 +0000 (12:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Nov 2018 12:53:03 +0000 (13:53 +0100)
Drop BUG() from the hbm handler in order not to crash the whole
kernel on faulty firmware implementation. Instead of it, just return
an error resulting into link reset.
There is no any known issue of faulty firmware in this matter,
the change is just to ease the development.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/hbm.c

index e56f3e72d57a06cc4a9c2e8358bd3359113524c8..fe67381b34c3c89868c7b6ceda878a2a8dc400e1 100644 (file)
@@ -1271,8 +1271,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
                break;
 
        default:
-               BUG();
-               break;
+               WARN(1, "hbm: wrong command %d\n", mei_msg->hbm_cmd);
+               return -EPROTO;
 
        }
        return 0;