drm_ras_nl_get_error_counter_dumpit() skips the IDs the driver reports
as -ENOENT, but keeps that value in ret. If the last ID of the range is
skipped, a complete dump then fails with -ENOENT.
Fixes: c36218dc49f5 ("drm/ras: Introduce the DRM RAS infrastructure over
generic netlink")
Reviewed-by: Michael J. Ruhl <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
---
drivers/gpu/drm/drm_ras.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_ras.c b/drivers/gpu/drm/drm_ras.c
index 4f4777060a4e..f561604e7e96 100644
--- a/drivers/gpu/drm/drm_ras.c
+++ b/drivers/gpu/drm/drm_ras.c
@@ -475,8 +475,10 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff
*skb,
* For non-contiguous range, driver return -ENOENT as indication
* to skip this ID when listing all errors.
*/
- if (ret == -ENOENT)
+ if (ret == -ENOENT) {
+ ret = 0;
continue;
+ }
if (ret)
return ret;
--
2.56.0