Add error handling for seqno operations.
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
if ((seqno_type == RAS_SEQNO_TYPE_DE) ||
(seqno_type == RAS_SEQNO_TYPE_POISON_CONSUMPTION)) {
ret = ras_core_put_seqno(ras_mgr->ras_core, seqno_type, seq_no);
- if (ret)
+ if (ret) {
RAS_DEV_WARN(adev, "There are too many ras interrupts!");
+ return 0;
+ }
}
return seq_no;
{
uint64_t seqno = 0;
- if (ras_core->sys_fn &&
- ras_core->sys_fn->gen_seqno)
- ras_core->sys_fn->gen_seqno(ras_core, type, &seqno);
+ if (ras_core->sys_fn && ras_core->sys_fn->gen_seqno &&
+ ras_core->sys_fn->gen_seqno(ras_core, type, &seqno))
+ return 0;
return seqno;
}