FAILED: patch "[PATCH] media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD" failed to apply to 4.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
250854eed5d45a73d81e4137dfd85180af6f2ec3Mon Sep 17 00:00:00 2001
From: Hans Verkuil <[email protected]>
Date: Mon, 8 Oct 2018 15:08:27 -0400
Subject: [PATCH] media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD
When the OSD is on (i.e. vivid displays text on top of the test pattern), and you enable hflip, then the driver crashes.
The cause turned out to be a division of a negative number by an unsigned value. You expect that -8 / 2U would be -4, but in reality it is 2147483644 :-(
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +1 -1
@@ -1801,7 +1801,7 @@ typedef struct { u16 __; u8 _; } __packed x24; pos[7 ] = (chr & (0x01 <<0 ) ? fg : bg); \ } \ \ - pos += (tpg->hflip ?-8 :8 ) / hdiv; \ + pos += (tpg->hflip ?-8 :8 ) / (int )hdiv; \ } \ } \ }while (0 )