• Frank Rowand's avatar
    of: some unittest overlays not untracked · 1adc8679
    Frank Rowand authored
    kernel test robot reported "WARNING: held lock freed!" triggered by
    unittest_gpio_remove(), which should not have been called because
    the related gpio overlay was not tracked.  Another overlay that
    was tracked had previously used the same id as the gpio overlay
    but had not been untracked when the overlay was removed.  Thus the
    clean up function of_unittest_destroy_tracked_overlays() incorrectly
    attempted to remove the reused overlay id.
    
    Patch contents:
    
      - Create tracking related helper functions
      - Change BUG() to WARN_ON() for overlay id related issues
      - Add some additional error checking for valid overlay id values
      - Add the missing overlay untrack
      - update comment on expectation that overlay ids are assigned in
        sequence
    
    Fixes: 492a22ac ("of: unittest: overlay: Keep track of created overlays")
    Reported-by: default avatarkernel test robot <lkp@intel.com>
    Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
    Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: default avatarRob Herring <robh@kernel.org>
    1adc8679
unittest.c 91.4 KB