소스 검색

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;