We only allocate FDP_MAX_RUHS reclaim unit handle status descriptors. It
is possible that the device will have more than this many descriptors.
Make sure we do not run over the end of the buffer we have allocated
when this happens.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
goto free;
fruhs_info->nr_ruhs = le16_to_cpu(ruhs->nruhsd);
+ if (fruhs_info->nr_ruhs > FDP_MAX_RUHS)
+ fruhs_info->nr_ruhs = FDP_MAX_RUHS;
for (i = 0; i < fruhs_info->nr_ruhs; i++)
fruhs_info->plis[i] = le16_to_cpu(ruhs->ruhss[i].pid);
free: