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=-5.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_MUTT autolearn=ham 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 C0BD4C072B5 for ; Fri, 24 May 2019 19:09:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E61C21851 for ; Fri, 24 May 2019 19:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558724985; bh=rViWCO4NqI43asf5Tq/IFk6AzanhJwwCd6fbS89zBxY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=WupTUFR87OqwRM4g7fjk9p/VYU1ivK6rVNo+34K6lBN1Qg75hERPldra2oxWradYd jeBTp1j1G/9GW9oYrOtRaGJAXn5+xSnHugFbNpvu9gIIzzek0pmWjn5sY9FeNzw+Kj M355tofiLLEDSLAK6yD9QyVccbFgRli9KqQL18xI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727344AbfEXTJp (ORCPT ); Fri, 24 May 2019 15:09:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:39234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbfEXTJo (ORCPT ); Fri, 24 May 2019 15:09:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 762352175B; Fri, 24 May 2019 19:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558724984; bh=rViWCO4NqI43asf5Tq/IFk6AzanhJwwCd6fbS89zBxY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lRIfeK4gJWRKNhSlttJahVSg02nFW7UDWLQwaKX3Ib5IW+CbDA1crArpjEZ8VfL0P TvaTLBgMZL5ukfM4AdeRxBOGTm925ZkRr0sX5Z3m22b2JvLAxKMS4p1Y0IYQsPX9vL WfVoyPt3T5biZTI704QtXftl+MKVNU/7HLHggCwk= Date: Fri, 24 May 2019 21:09:41 +0200 From: Greg Kroah-Hartman To: Mauro Carvalho Chehab Cc: Alan Stern , Allison Randal , Steve Winslow , Wen Yang , Thomas Gleixner , stable@vger.kernel.org Subject: Re: [PATCH v2] media: smsusb: better handle optional alignment Message-ID: <20190524190941.GA18849@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, May 24, 2019 at 10:59:43AM -0400, Mauro Carvalho Chehab wrote: > Most Siano devices require an alignment for the response. > > Changeset f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb") > changed the logic with gets such aligment, but it now produces a > sparce warning: > > drivers/media/usb/siano/smsusb.c: In function 'smsusb_init_device': > drivers/media/usb/siano/smsusb.c:447:37: warning: 'in_maxp' may be used uninitialized in this function [-Wmaybe-uninitialized] > 447 | dev->response_alignment = in_maxp - sizeof(struct sms_msg_hdr); > | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > The sparse message itself is bogus, but a broken (or fake) USB > eeprom could produce a negative value for response_alignment. > > So, change the code in order to check if the result is not > negative. > > Fixes: f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb") > CC: > Signed-off-by: Mauro Carvalho Chehab > --- > > Greg, > > As the Alan patches went via your tree, please apply this one too. Thanks, now done, and I fixed up the Fixes: sha1 tag to match my tree. greg k-h