mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user