From 87cd84c7ce2c1928bf3b66892f5537904bf6187b Mon Sep 17 00:00:00 2001 From: jmcneill Date: Tue, 2 Mar 2021 11:51:00 +0000 Subject: Fix previous: Each line is "stride" bytes wide, not "width * depth". While here, add a comment explaining what this test is doing. --- sys/dev/fdt/simplefb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index c3803779608..993a1165d9a 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $NetBSD: simplefb.c,v 1.13 2021/03/02 07:02:06 skrll Exp $ */ +/* $NetBSD: simplefb.c,v 1.14 2021/03/02 11:51:00 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_wsdisplay_compat.h" #include -__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.13 2021/03/02 07:02:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.14 2021/03/02 11:51:00 jmcneill Exp $"); #include #include @@ -169,7 +169,7 @@ simplefb_attach_genfb(struct simplefb_softc *sc) return ENXIO; } - if (size < width * height * depth) { + if (size < stride * height) { aprint_error(": incorrect size\n"); return ENXIO; } -- cgit