Merge tag 'regmap-fix-v6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-starfive.git] / drivers / counter / counter-chrdev.c
index 80acdf6..afc94d0 100644 (file)
@@ -247,8 +247,8 @@ static int counter_get_ext(const struct counter_comp *const ext,
                if (*id == component_id)
                        return 0;
 
-               if (ext->type == COUNTER_COMP_ARRAY) {
-                       element = ext->priv;
+               if (ext[*ext_idx].type == COUNTER_COMP_ARRAY) {
+                       element = ext[*ext_idx].priv;
 
                        if (component_id - *id < element->length)
                                return 0;