瀏覽代碼

video: driver: assign session id as hash value

Use hashed value for session id to over come the
same session ids being used concurrently where
one session is being closed and the other session
opening might be getting same session id.

Change-Id: I0bba056f26e404a7ff3b92ca9a81e673a0a6802f
Signed-off-by: Maheshwar Ajja <[email protected]>
Maheshwar Ajja 4 年之前
父節點
當前提交
4765d28baa
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      driver/vidc/src/msm_vidc_driver.c

+ 2 - 1
driver/vidc/src/msm_vidc_driver.c

@@ -5,6 +5,7 @@
 
 #include <linux/iommu.h>
 #include <linux/workqueue.h>
+#include <linux/hash.h>
 #include <media/v4l2_vidc_extensions.h>
 #include "msm_media_info.h"
 
@@ -1994,7 +1995,7 @@ int msm_vidc_add_session(struct msm_vidc_inst *inst)
 	mutex_unlock(&core->lock);
 
 	/* assign session_id */
-	inst->session_id = count + 1;
+	inst->session_id = hash32_ptr(inst);
 	inst->sid = inst->session_id;
 
 	return rc;