From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BDD4C433E6 for ; Thu, 18 Mar 2021 13:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CCAF64F53 for ; Thu, 18 Mar 2021 13:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbhCRN0G (ORCPT ); Thu, 18 Mar 2021 09:26:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:58680 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbhCRNZq (ORCPT ); Thu, 18 Mar 2021 09:25:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2014EAB8C; Thu, 18 Mar 2021 13:25:45 +0000 (UTC) Date: Thu, 18 Mar 2021 14:25:45 +0100 Message-ID: From: Takashi Iwai To: Colin King Cc: Olivia Mackintosh , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: usb-audio: Fix unintentional sign extension issue In-Reply-To: <20210318132008.15266-1-colin.king@canonical.com> References: <20210318132008.15266-1-colin.king@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Mar 2021 14:20:08 +0100, Colin King wrote: > > From: Colin Ian King > > The shifting of the u8 integer device by 24 bits to the left will > be promoted to a 32 bit signed int and then sign-extended to a > 64 bit unsigned long. In the event that the top bit of device is > set then all then all the upper 32 bits of the unsigned long will > end up as also being set because of the sign-extension. Fix this > by casting device to an unsigned long before the shift. > > Addresses-Coverity: ("Unintended sign extension") > Fixes: a07df82c7990 ("ALSA: usb-audio: Add DJM750 to Pioneer mixer quirk") > Signed-off-by: Colin Ian King Thanks, applied now. Takashi