MIPS: fix truncation in __cmpxchg_small for short values
Michael Clark authored
commit 94ee12b5

 upstream.

__cmpxchg_small erroneously uses u8 for load comparison which can
be either char or short. This patch changes the local variable to
u32 which is sufficiently sized, as the loaded value is already
masked and shifted appropriately. Using an integer size avoids
any unnecessary canonicalization from use of non native widths.

This patch is part of a series that adapts the MIPS small word
atomics code for xchg and cmpxchg on short and char to RISC-V.

Cc: RISC-V Patches <patches@groups.riscv.org>
Cc: Linux RISC-V <linux-riscv@lists.infradead.org>
Cc: Linux MIPS <linux-mips@linux-mips.org>
Signed-off-by: default avatarMichael Clark <michaeljclark@mac.com>
[paul.burton@mips.com:
  - Fix varialble typo per Jonas Gorski.
  - Consolidate load variable with other declarations.]
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Fixes: 3ba7f44d ("MIPS: cmpxchg: Implement 1 byte & 2 byte cmpxchg()")
Cc: stable@vger...
3bfa6413
Name Last commit Last update
Documentation dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text
arch MIPS: fix truncation in __cmpxchg_small for short values
block blk-mq: fix a hung issue when fsync
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
crypto net: crypto set sk to NULL when af_alg_release.
drivers drm: Block fb changes for async plane updates
firmware kbuild: remove all dummy assignments to obj-
fs hugetlbfs: fix races and page leaks during migration
include net: dev_is_mac_header_xmit() true for ARPHRD_RAWIP
init kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7
ipc ipc/shm.c: use ERR_CAST() for shm_lock() error return
kernel locking/rwsem: Fix (possible) missed wakeup
lib lib/test_rhashtable: Make test_insert_dup() allocate its hash table dynamically
mm hugetlbfs: fix races and page leaks during migration
net cfg80211: extend range deviation for DMG
samples samples: mei: use /dev/mei0 instead of /dev/mei
scripts scripts/gdb: fix lx-version string output
security KEYS: always initialize keyring_index_key::desc_len
sound ASoC: imx-audmux: change snprintf to scnprintf for possible overflow
tools kvm: selftests: Fix region overlap check in kvm_util
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/
virt kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
.clang-format clang-format: Set IndentWrappedFunctionNames false
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore Merge tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
.mailmap Merge tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm
COPYING COPYING: use the new text with points to the license files
CREDITS 9p: remove Ron Minnich from MAINTAINERS
Kbuild Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
MAINTAINERS MAINTAINERS: Add Sasha as a stable branch maintainer
Makefile Linux 4.19.26
README Docs: Added a pointer to the formatted docs to README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.