aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
diff options
context:
space:
mode:
authorNikos Tsironis <[email protected]>2020-03-27 14:01:11 +0000
committerMike Snitzer <[email protected]>2020-03-27 18:42:51 +0000
commit81d5553d1288c2ec0390f02f84d71ca0f0f9f137 (patch)
tree76cc780f85a499ce39c5cbbf585812d64625902f /drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
parentdm clone: Add missing casts to prevent overflows and data corruption (diff)
downloadkernel-81d5553d1288c2ec0390f02f84d71ca0f0f9f137.tar.gz
kernel-81d5553d1288c2ec0390f02f84d71ca0f0f9f137.zip
dm clone metadata: Fix return type of dm_clone_nr_of_hydrated_regions()
dm_clone_nr_of_hydrated_regions() returns the number of regions that have been hydrated so far. In order to do so it employs bitmap_weight(). Until now, the return type of dm_clone_nr_of_hydrated_regions() was unsigned long. Because bitmap_weight() returns an int, in case BITS_PER_LONG == 64 and the return value of bitmap_weight() is 2^31 (the maximum allowed number of regions for a device), the result is sign extended from 32 bits to 64 bits and an incorrect value is displayed, in the status output of dm-clone, as the number of hydrated regions. Fix this by having dm_clone_nr_of_hydrated_regions() return an unsigned int. Fixes: 7431b7835f55 ("dm: add clone target") Cc: [email protected] # v5.4+ Signed-off-by: Nikos Tsironis <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c')
0 files changed, 0 insertions, 0 deletions