Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon Set "enabled" value on...



details:   https://anonhg.NetBSD.org/src/rev/90a2c798051d
branches:  trunk
changeset: 1002822:90a2c798051d
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sat Aug 17 15:49:13 2019 +0000

description:
Set "enabled" value only when hpd.hpd is not RADEON_HPD_NONE(== 0xff) to
avoid 1 << 255. Found by kUBSan.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 2d397d1a493d -r 90a2c798051d sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c  Sat Aug 17 12:37:49 2019 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c  Sat Aug 17 15:49:13 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_evergreen.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $   */
+/*     $NetBSD: radeon_evergreen.c,v 1.2 2019/08/17 15:49:13 msaitoh Exp $     */
 
 /*
  * Copyright 2010 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  * Authors: Alex Deucher
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen.c,v 1.2 2019/08/17 15:49:13 msaitoh Exp $");
 
 #include <linux/bitops.h>
 #include <linux/firmware.h>
@@ -1872,7 +1872,8 @@
                        break;
                }
                radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
-               enabled |= 1 << radeon_connector->hpd.hpd;
+               if (radeon_connector->hpd.hpd != RADEON_HPD_NONE)
+                       enabled |= 1 << radeon_connector->hpd.hpd;
        }
        radeon_irq_kms_enable_hpd(rdev, enabled);
 }



Home | Main Index | Thread Index | Old Index