Skip to content

Commit da785a8

Browse files
andy-shevNicolas Saenz Julienne
authored andcommitted
ARM: bcm2835: Fix integer overflow in rpi_firmware_print_firmware_revision()
time64_t is 64-bit width type, we are not supposed to supply lesser ones as in the case of rpi_firmware_print_firmware_revision() after the commit 4a60f58 ("ARM: bcm2835: Switch to use %ptT"). Use temporary variable of time64_t type to correctly handle lesser types. Fixes: 4a60f58 ("ARM: bcm2835: Switch to use %ptT") Reported-by: Stefan Wahren <[email protected]> Reported-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Revieved-by: Petr Mladek <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Nicolas Saenz Julienne <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b3a9e3b commit da785a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/firmware/raspberrypi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property);
181181
static void
182182
rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
183183
{
184+
time64_t date_and_time;
184185
u32 packet;
185186
int ret = rpi_firmware_property(fw,
186187
RPI_FIRMWARE_GET_FIRMWARE_REVISION,
@@ -189,7 +190,9 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
189190
if (ret)
190191
return;
191192

192-
dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &packet);
193+
/* This is not compatible with y2038 */
194+
date_and_time = packet;
195+
dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time);
193196
}
194197

195198
static void

0 commit comments

Comments
 (0)