media: fixed the issure of crash when get pts rec num.

PD#158950: fixed the issure of crash when get pts rec num.

Change-Id: Iadba80bd5c0c1c4dc001e0321ed0e1a460c57ced
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
This commit is contained in:
Nanxin Qin
2018-01-16 16:02:49 +08:00
committed by Jianxin Pan
parent 05a1bf9ad2
commit 8474a382fb

View File

@@ -1060,11 +1060,14 @@ int pts_get_rec_num(u8 type, u32 val)
pTable = &pts_table[type];
if (list_empty(&pTable->valid_list))
return 0;
spin_lock_irqsave(&lock, flags);
if (pTable->status != PTS_RUNNING)
goto out;
if (list_empty(&pTable->valid_list))
goto out;
if (pTable->pts_search == &pTable->valid_list) {
p = list_entry(pTable->valid_list.next,
struct pts_rec_s, list);
@@ -1085,6 +1088,7 @@ int pts_get_rec_num(u8 type, u32 val)
r++;
}
out:
spin_unlock_irqrestore(&lock, flags);
return r;