OSDN Git Service

android: Simply exit if hal_ipc_cmd gets an invalid fd
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 22 Oct 2013 14:00:30 +0000 (17:00 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 22 Oct 2013 14:01:55 +0000 (17:01 +0300)
android/hal-ipc.c

index f753f10..cd3e266 100644 (file)
@@ -260,8 +260,10 @@ int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param,
        char cmsgbuf[CMSG_SPACE(sizeof(int))];
        struct hal_msg_rsp_error err;
 
-       if (cmd_sk < 0)
-               return -EBADF;
+       if (cmd_sk < 0) {
+               error("Invalid cmd socket passed to hal_ipc_cmd, aborting");
+               exit(EXIT_FAILURE);
+       }
 
        if (!rsp || rsp_len == 0) {
                memset(&err, 0, sizeof(err));