Date: Wed, 18 Nov 2015 22:20:04 +0000 (UTC) From: "Conrad E. Meyer" <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291029 - head/sys/dev/ntb/ntb_hw Message-ID: <201511182220.tAIMK4vM084154@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Wed Nov 18 22:20:04 2015 New Revision: 291029 URL: https://svnweb.freebsd.org/changeset/base/291029 Log: NTB: Fix 32-bit BAR size validation Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 18 22:19:55 2015 (r291028) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 18 22:20:04 2015 (r291029) @@ -2575,9 +2575,9 @@ ntb_mw_set_trans(struct ntb_softc *ntb, } else { /* Configure 32-bit (split) BAR MW */ - if ((addr & ~UINT32_MAX) != 0) + if ((addr & UINT32_MAX) != addr) return (EINVAL); - if (((addr + size) & ~UINT32_MAX) != 0) + if (((addr + size) & UINT32_MAX) != (addr + size)) return (EINVAL); base = ntb_reg_read(4, base_reg);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511182220.tAIMK4vM084154>