aboutsummaryrefslogtreecommitdiff
path: root/include/linux/debugobjects.h
diff options
context:
space:
mode:
authorMaciej W. Rozycki <[email protected]>2007-10-16 01:29:56 -0700
committerLinus Torvalds <[email protected]>2007-10-16 09:43:23 -0700
commitb738b990468d2acd5be7fe177fb750448bfa0b37 (patch)
tree496295879208953b67ed5e8aaa49f675c68423f2 /include/linux/debugobjects.h
parent4d8a2d986d3ee3ece9c3cefbb23425a22132492c (diff)
tgafb: fix an out-of-range shift in mono imageblit
The pixel mask calculation in tgafb_mono_imageblit() uses a variable left-shift on a 32-bit data type by up to 32. Shifting by the width of a data type or more produces an unpredictable result according to the C standard. Rather than widening the data type this fix makes sure the count is between 0 and 31. The reason is not to penalise 32-bit platforms with operation on a "long long" type for a marginal case that is meant not to happen (blitting an image of a zero width). The reason it has escaped for so long is the Alpha, being purely 64-bit, :-) does not mask the shift out to 32 bits. This is a valid implementation -- producing the correct result certainly falls within "unpredictable behaviour". It does trigger on MIPS though and it is the recent merge of the TC support which only enabled the driver for use on anything other than the Alpha. For MIPS when the width is 32 the mask ends up being 0 rather than 0xffffffff as it should be and the frame buffer is not updated. Signed-off-by: Maciej W. Rozycki <[email protected]> Cc: Antonino Daplas <[email protected]> Cc: Jay Estabrook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions