OSDN Git Service

qseecom: fix listener unregistration issue
authorZhen Kong <zkong@codeaurora.org>
Thu, 1 Jun 2017 22:06:00 +0000 (15:06 -0700)
committerZhen Kong <zkong@codeaurora.org>
Thu, 1 Jun 2017 23:04:19 +0000 (16:04 -0700)
When listener unregister thread wakes up due to some system signals,
but not because ioctl_cnt <=1, it should return directly, instead of
continuing to remove listener list entry, which will lead kernel panic
when another listener receive thread accesses this freed entry.

Change-Id: I6ff97c56867d008232d7c50b22b372b0856c8dff
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
drivers/misc/qseecom.c

index 1c7cc91..7d09f22 100644 (file)
@@ -1257,7 +1257,7 @@ static int qseecom_unregister_listener(struct qseecom_dev_handle *data)
                                atomic_read(&data->ioctl_count) <= 1)) {
                        pr_err("Interrupted from abort\n");
                        ret = -ERESTARTSYS;
-                       break;
+                       return ret;
                }
        }