diff options
| author | Yury Norov <ynorov@nvidia.com> | 2026-07-08 22:03:10 -0400 |
|---|---|---|
| committer | Yury Norov <ynorov@nvidia.com> | 2026-07-22 15:38:38 -0400 |
| commit | e46185c13953500ed868751b944a96974eaca923 (patch) | |
| tree | 78074ebfa3fb22d4a605954f334a484c1956ca3b /drivers/media/platform | |
| parent | c69269f941b8c0c527ea2319556df0e21b8f3f52 (diff) | |
| download | linux-next-e46185c13953500ed868751b944a96974eaca923.tar.gz linux-next-e46185c13953500ed868751b944a96974eaca923.zip | |
media: s5p-mfc: Treat bitmap size as allocation failure
bitmap_find_next_zero_area() uses an out-of-range return value to
indicate failure. Check for values greater than or equal to the bitmap
size so the caller does not depend on the exact failure sentinel.
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'drivers/media/platform')
| -rw-r--r-- | drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c index 5ba791fa3676..b25ad2a37196 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c @@ -43,7 +43,7 @@ int s5p_mfc_alloc_priv_buf(struct s5p_mfc_dev *dev, unsigned int mem_ctx, if (dev->mem_virt) { start = bitmap_find_next_zero_area(dev->mem_bitmap, bits, 0, count, align); - if (start > bits) + if (start >= bits) goto no_mem; bitmap_set(dev->mem_bitmap, start, count); |
