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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6DB2C433F5 for ; Tue, 12 Apr 2022 14:36:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356695AbiDLOjO (ORCPT ); Tue, 12 Apr 2022 10:39:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352025AbiDLOjN (ORCPT ); Tue, 12 Apr 2022 10:39:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 427475F268; Tue, 12 Apr 2022 07:36:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E9313B81E80; Tue, 12 Apr 2022 14:36:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52E28C385A9; Tue, 12 Apr 2022 14:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649774212; bh=pX2rBIpn2exoLft39iyMB6kQtWkSYw6SG76OGvUgMVY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c+2CJJZpvxDBYXwQwvOEelNmnxnaKDMOkKAxHmNdHHfMmztLIAXHuDVqaW1FRQnfI Ph5N4bczHjIZlwRAP5crc3eHxNqRaRgjZf8DitB8TZ+kOf/b2hU/K3XQRH6uhXenSR KBRVKOAcR0mJQbjSPHrhwTzRkzux4NUJEhEFNPnk= Date: Tue, 12 Apr 2022 16:36:49 +0200 From: Greg KH To: Lin Ma Cc: stern@rowland.harvard.edu, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, mdharm-usb@one-eyed-alien.net, stable@vger.kernel.org Subject: Re: [PATCH v3] USB: storage: karma: fix rio_karma_init return Message-ID: References: <20220412021246.18340-1-linma@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412021246.18340-1-linma@zju.edu.cn> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Tue, Apr 12, 2022 at 10:12:46AM +0800, Lin Ma wrote: > The function rio_karam_init() should return -ENOMEM instead of > value 0 (USB_STOR_TRANSPORT_GOOD) when allocation fails. > > Simlarlly, it should return -EIO when rio_karma_send_command() fails. > > Cc: stable@vger.kernel.org > Fixes: dfe0d3ba20e8 ("USB Storage: add rio karma eject support") > Signed-off-by: Lin Ma > Acked-by: Alan Stern > --- > drivers/usb/storage/karma.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/storage/karma.c b/drivers/usb/storage/karma.c > index 05cec81dcd3f..38ddfedef629 100644 > --- a/drivers/usb/storage/karma.c > +++ b/drivers/usb/storage/karma.c > @@ -174,24 +174,25 @@ static void rio_karma_destructor(void *extra) > > static int rio_karma_init(struct us_data *us) > { > - int ret = 0; > struct karma_data *data = kzalloc(sizeof(struct karma_data), GFP_NOIO); > > if (!data) > - goto out; > + return -ENOMEM; > > data->recv = kmalloc(RIO_RECV_LEN, GFP_NOIO); > if (!data->recv) { > kfree(data); > - goto out; > + return -ENOMEM; > } > > us->extra = data; > us->extra_destructor = rio_karma_destructor; > - ret = rio_karma_send_command(RIO_ENTER_STORAGE, us); > - data->in_storage = (ret == 0); > -out: > - return ret; > + if (rio_karma_send_command(RIO_ENTER_STORAGE, us)) > + return -EIO; > + > + data->in_storage = 1; > + > + return 0; > } > > static struct scsi_host_template karma_host_template; > -- > 2.35.1 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot