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=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 32FE6C432BE for ; Fri, 27 Aug 2021 08:59:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C29B608FE for ; Fri, 27 Aug 2021 08:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244648AbhH0I75 (ORCPT ); Fri, 27 Aug 2021 04:59:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232757AbhH0I7y (ORCPT ); Fri, 27 Aug 2021 04:59:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF9EB60FDA; Fri, 27 Aug 2021 08:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630054745; bh=MCi/iLwDS2lKNvQHC6owLIj+45AM4PBViJAXy7zxvd8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Kogy+aRcFo00z5sZSqNR/2BF8GGrGago3CiX3fVplZ6QJQoQDlRqjoEHb1YZMC5KM Q7DB+W3+gfJtj9ERzajJnEuj1ZICuuF2cceznbf3Ti2E7brQKUMPk5Ta9k9pEbmpWV fp6At5m1YCWiDhIio8Rec2WNLipR8jwRY+0M8M5Y= Date: Fri, 27 Aug 2021 10:59:02 +0200 From: Greg KH To: yang.yang29@zte.com.cn Cc: salah.triki@gmail.com, linux-kernel@vger.kernel.org, xu.xin16@zte.com.cn Subject: Re: [PATCH] dio: add missing iounmap() after ioremap() Message-ID: References: <202108232045471583580@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108232045471583580@zte.com.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021 at 08:45:47PM +0800, yang.yang29@zte.com.cn wrote: > From: xu xin > > If kzalloc() fails, the 'va' needs to be unmapped before returning -ENOMEM. > > Reported-by: Zeal Robot > Signed-off-by: xu xin > --- > drivers/dio/dio.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletions(-) > > diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c > index 4c06c93..7d19250 100644 > --- a/drivers/dio/dio.c > +++ b/drivers/dio/dio.c > @@ -218,9 +218,11 @@ static int __init dio_init(void) > > /* Found a board, allocate it an entry in the list */ > dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); > - if (!dev) > + if (!dev) { > + if (scode >= DIOII_SCBASE) > + iounmap(va); > return -ENOMEM; > + } > dev->bus = &dio_bus; > dev->dev.parent = &dio_bus.dev; > dev->dev.bus = &dio_bus_type; > -- > 2.15.2 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: - Your patch contains warnings and/or errors noticed by the scripts/checkpatch.pl tool. - Your patch is malformed (tabs converted to spaces, linewrapped, etc.) and can not be applied. Please read the file, Documentation/email-clients.txt in order to fix 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