From owner-svn-src-all@freebsd.org Mon Sep 9 03:31:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48D86EBFB0; Mon, 9 Sep 2019 03:31:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RYcM0hVDz4Qt5; Mon, 9 Sep 2019 03:31:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0947777D; Mon, 9 Sep 2019 03:31:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x893VkWr082290; Mon, 9 Sep 2019 03:31:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x893Vkje082289; Mon, 9 Sep 2019 03:31:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201909090331.x893Vkje082289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 9 Sep 2019 03:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352054 - head/sys/dev/ral X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/ral X-SVN-Commit-Revision: 352054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 03:31:47 -0000 Author: pfg Date: Mon Sep 9 03:31:46 2019 New Revision: 352054 URL: https://svnweb.freebsd.org/changeset/base/352054 Log: ral(4): Use unsigned to avoid undefined behavior. Found by NetBSD's kUBSan Obtained from: NetBSD (github 5b153f1) Modified: head/sys/dev/ral/rt2860.c Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Mon Sep 9 01:33:45 2019 (r352053) +++ head/sys/dev/ral/rt2860.c Mon Sep 9 03:31:46 2019 (r352054) @@ -2220,7 +2220,7 @@ static void rt2860_enable_mrr(struct rt2860_softc *sc) { #define CCK(mcs) (mcs) -#define OFDM(mcs) (1 << 3 | (mcs)) +#define OFDM(mcs) (1U << 3 | (mcs)) RAL_WRITE(sc, RT2860_LG_FBK_CFG0, OFDM(6) << 28 | /* 54->48 */ OFDM(5) << 24 | /* 48->36 */ @@ -3325,7 +3325,7 @@ b4inc(uint32_t b32, int8_t delta) b4 = 0; else if (b4 > 0xf) b4 = 0xf; - b32 = b32 >> 4 | b4 << 28; + b32 = b32 >> 4 | (uint32_t)b4 << 28; } return b32; }