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")
Cc: Zack McKevitt <[email protected]>
Cc: Jeff Hugo <[email protected]>
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 bc30bf0745e5..82fcc766b84b 100644
--- a/drivers/gpu/drm/drm_ras.c
+++ b/drivers/gpu/drm/drm_ras.c
@@ -616,8 +616,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)
break;
--
2.56.0