Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp825248lqp; Thu, 23 May 2024 00:36:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX83DkGY49+AEXQwRhJlNFD+XvHPzlgrHQMRw6QcKU9tMw5NatkdtYbbJzzu3km8wsHI/z79IACJlTq2rpo7PCApFr6702PRNLLBGc3xQ== X-Google-Smtp-Source: AGHT+IFKb/9zFapE/Gg6hNqp3uRqz9mnRYSewuNkEnFYMxth6omFSb7uvmGIDT9MxVvDKdr+4lqh X-Received: by 2002:a17:90b:24f:b0:2bd:e936:b28 with SMTP id 98e67ed59e1d1-2bde9360f3bmr674921a91.20.1716449794156; Thu, 23 May 2024 00:36:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716449794; cv=pass; d=google.com; s=arc-20160816; b=WRzbFU6rFXZ858UDE/5RlaTi7uop/e1L2j+ysvNCkJ9eTHi563+q3FKC4maUPf80tE NP39kf5jTDcG37c+gJ8j8Rez/cJ7tghYm0VE+cdKoD/IEHtj7GX5aiwR0skA/PfhPIEZ Clz1z653T4E6cKP0edOK+j/ritvdeYaT0EexiF/YRCleQXaVtmJyasYk0uPISKDv34On rBgcDZmZBVCSGD8dPNJr67H6K9ghz7/wdV7z/YDic86/LF8CRsvpP5Dv/EWTMbnE/RBu han2jLIrfeYbhQkwf7pSMNHUKvMEDoP6d6SyNnlZ/y+nnDld6THEap4LQ88/qZI+MO6o 98nQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nFuC+IQzypvvf/fRrr4tCoKX0Jx5GvmpAGFj7Hzg86c=; fh=LuVmvlQybw069I3ulxsrY8dm55J8b5DpA2IYzY1WvtI=; b=teTQsXUMnWb/g4i/BP4oqUiP3NS6Jr4h9a4h2z5Rb2VH9Kw17ii/aV9h1ET18MU2zw arldQUwu6r70VUw7PjjI3mwc0p4V/biaYyEqOcqVOduIfU7ceNJZjQm9w0LAEvF2x9KA DWBPzS7yg9Po4zR5wHlfenj1yEbhqJE7QfHJjdDKrG0JqffM8E1g87mVn6Uaf23bufrW BjQhWbzEt4r8wCsY5sC7rCrTWy/vxfl1Pr/JKcW1BVAeILrFwP376OnJiTTuwZ5IJI7N ZlJnwVAbtGCzFhmMXaeUKovAQYmAy5ihIeFUG/FawIWPiUD+08t1oIdJARxvm0hPRCrQ 1l9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="YdJ/BuzX"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187099-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdda92a7eesi1114775a91.78.2024.05.23.00.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 00:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187099-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="YdJ/BuzX"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187099-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3FF4BB219D0 for ; Thu, 23 May 2024 07:36:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05DC413CAAD; Thu, 23 May 2024 07:36:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YdJ/BuzX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19CFC13C809; Thu, 23 May 2024 07:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716449772; cv=none; b=UZ0vMnx50Hz8VuOMg0ODHPXcKgB+3TE1fQL5eieR1jkhJq0TQP6fVnFfb+LQOIst4C+0rPspZeFhe/zydqiU8tyBSpZl8Uok14yAI+w7uauO3aZ6D2EnlRNH9+iY2IrIRNzRQqrv3dArklAiWqEX0p3Il7SEEygSDT3c+kLM3E8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716449772; c=relaxed/simple; bh=ZVXhu+FLBy1CzMwEfEAguNuZ/zCGkVR+Om75Tniq6VI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cxkkq0JNNSE76jIGkZ8gq/j3DzUV8ZKHMS/Idrys7RksiUWOPcI3vUbdJceogntONO4uwWzdKmofM2X1NkWPQuKT9ZYXyMAawU1bs75E5crYHUuE7SQ4tJvdmU9kbjS8hS5KkuCYfTjlk5kVXV5FVSsqFDIm1z87+U80smLk7Xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YdJ/BuzX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46206C2BD10; Thu, 23 May 2024 07:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716449771; bh=ZVXhu+FLBy1CzMwEfEAguNuZ/zCGkVR+Om75Tniq6VI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YdJ/BuzXaIAP99iZyNFDJXjbUPTHNjoyJLzESWTB9nd+x1QI54nNI8fCBHNQEKek3 YRrZet6z87ETJa38yZ4RgjXDTF97rdHAhoNt1Hf9lDiNbIY08bYobjQ40n3a+YS51M PI1T/+HHFuQ5MZf0FnGO2ZHV18pYNAyNMU4FCQyo= Date: Thu, 23 May 2024 09:36:08 +0200 From: Greg KH To: Shichao Lai Cc: stern@rowland.harvard.edu, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org, xingwei lee , yue sun Subject: Re: [PATCH] Check whether divisor is non-zero before division Message-ID: <2024052349-gossip-blurry-eda0@gregkh> References: <20240523072242.787164-1-shichaorai@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240523072242.787164-1-shichaorai@gmail.com> On Thu, May 23, 2024 at 03:22:42PM +0800, Shichao Lai wrote: > Since uzonesize may be zero, so a judgement for non-zero is nessesary. > > Reported-by: xingwei lee > Reported-by: yue sun > Signed-off-by: Shichao Lai > --- > drivers/usb/storage/alauda.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c > index 115f05a6201a..db075a8c03cb 100644 > --- a/drivers/usb/storage/alauda.c > +++ b/drivers/usb/storage/alauda.c > @@ -947,6 +947,8 @@ static int alauda_read_data(struct us_data *us, unsigned long address, > sg = NULL; > > while (sectors > 0) { > + if (!uzonesize) > + return USB_STOR_TRANSPORT_ERROR; > unsigned int zone = lba / uzonesize; /* integer division */ > unsigned int lba_offset = lba - (zone * uzonesize); > unsigned int pages; > -- > 2.34.1 > > Looks good, thanks! I'll queue this up after 6.10-rc1 is out. greg k-h