Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1716557imm; Thu, 14 Jun 2018 02:40:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4D59G9qVX74FMMRTtlpH5I4q9iohKcGkWpOool3ybc+K26aLKWC1Rpet/ga12m2CUzLxW X-Received: by 2002:a62:6f86:: with SMTP id k128-v6mr8736669pfc.150.1528969220643; Thu, 14 Jun 2018 02:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528969220; cv=none; d=google.com; s=arc-20160816; b=y6KW1Tcq2gdgOzQmv6HJfnobv4Oc8HtoZsQV74yFSYVwr18Djzt4hpZ8x45AwLSmQm pCQ/qEeTBq6SUTXGp/CCuLpxkFUyJJCXUDzrNaHT+Rm+t2fBts+CnDb2p4H47UCstvth jVeJEYNZLexOpYv21lvKScLbOlmGMp/h7f02ucLcXf2oJyyOK+Z8CGcMnGlGsEw1wJjJ qmxqvLA0ErNOpafm1rw3YPFR1EwMBnKvEbUDSzAw1Uq7Uf1cfGuZEx8GOkpD07IMEXgG F0ljbBDYCUTD323RLVCF0TItrHAz5708k+obpFIBSAhQydV3mF/I9a6FhMca8DEQAGRO 34sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=SynObiqS5YLv2KIqaqiENDnVws1Gvk/JzSHGiwNG0Ro=; b=vJtkipRHIaXFe9oxlvCn1jmu3syC/wKX59LaCn2Yo/ECRZXy6j0vonw3P7hKmeeIJ7 HIRL9FkFu4RwNP4xhu9m3hkCnbscj6z/egg0ywTpD/vS8S4ZgA2nJHEdeu3IISdvsxSl JMDJwYBzd0nefp6e1YtDc5K//7Qtwv9SW7SjcmLP6aHa8LrNpZn5zYpSIhPPCHHALLjF FYxsCxX43oZlhVfObyorddmm5tQq9Brqxt4H7U6EKbt3ExRiZIE1iVZrI7XX7sx6Q9+b ndMZtcscsWg2jPdCh13mpSisB6KGVabNCAJxDAO6e7MaP9pMqiNKwYo9oSXi/chx4xmt CHyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=idBTBfYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e95-v6si5137918plb.239.2018.06.14.02.40.06; Thu, 14 Jun 2018 02:40:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=idBTBfYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754782AbeFNJjl (ORCPT + 99 others); Thu, 14 Jun 2018 05:39:41 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:41642 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754571AbeFNJjj (ORCPT ); Thu, 14 Jun 2018 05:39:39 -0400 Received: by mail-ua0-f193.google.com with SMTP id a5-v6so3668952uao.8; Thu, 14 Jun 2018 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SynObiqS5YLv2KIqaqiENDnVws1Gvk/JzSHGiwNG0Ro=; b=idBTBfYjUMCUa1RfDrJT+cKMa8hiQnNCuE9bCJGl8KFCrK3OVe88GpBYhPHo/J04Cy nHBK5QkGNlIMFPT+WWElJRVD+Iaqs0cJdAFd/mtu7SMaBr5wjpIKDZiZrKAYkAN8phWR QYfuOIgXfSbobhOtilU7XZU/NkyHkLSVe+cg/W9urgQDHPOYDwzjJkNfFAqL+LQp3tP4 43+e4TyL+UI3v9nWf0ormPqfxqjwdFbmZjDeX8BGo6y4gUExcKsYrTWERDWz/PqVLpPR 0j4ovr6/DJbVObdq3PMWKwtT6oOZvucdTffylP1wsJh1eGJR36Y2W294qW0sFQYM1MbS 31GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SynObiqS5YLv2KIqaqiENDnVws1Gvk/JzSHGiwNG0Ro=; b=KZJmlKIpIwjSikUAEKQirXrz9E534n+KaUywN3TnGgHbsizjcHp6bqh1bC5ldWguVW /J0uNjnl3DccTp09bdTQ2Xluyfu9yBk0HghGJwjy51wDCDw3TppGLdZlJObPWN17/jfg YEA3cM+NzMlgvK6ZpEsWlOV6c4rOAoOIPMa0ag2ZLW82O3g+3wkxHaKn9D1/MdvCpCCJ VMJIw4Rh44KWVnuMWzHaGyGhyAAmcEmeC/Y7/+r34olBInSwgGTb+eGZICkQLiCYKr8J Jv179ijT8q1wA0YuwVuY+MH3Tj1M4nD5iWxipjDN1s2nCO/efUADcUUss+2DZj3Qm/v6 3sEw== X-Gm-Message-State: APt69E3Qp0EuCwz/wfvITMhXlLjgy+s9FuhVrlaerY0bnzETlGpP4RTH /+LV3fys5VnvB3U3K5p3MxfUwYb/mSZbCB7AXIM= X-Received: by 2002:ab0:7089:: with SMTP id m9-v6mr1127834ual.141.1528969178553; Thu, 14 Jun 2018 02:39:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 02:39:37 -0700 (PDT) In-Reply-To: <1528968207-48671-1-git-send-email-jiazhouyang09@gmail.com> References: <1528694152-31724-1-git-send-email-jiazhouyang09@gmail.com> <1528968207-48671-1-git-send-email-jiazhouyang09@gmail.com> From: Andy Shevchenko Date: Thu, 14 Jun 2018 12:39:37 +0300 Message-ID: Subject: Re: [PATCH v2] pcmcia: add error handling for pcmcia_enable_device To: Zhouyang Jia Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Johannes Thumshirn , Hannes Reinecke , linux-scsi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 14, 2018 at 12:23 PM, Zhouyang Jia wrote: > When pcmcia_enable_device fails, the lack of error-handling code may > cause unexpected results. What results? You need to elaborate this., > This patch adds error-handling code after calling pcmcia_enable_device. > + int ret; > + > + ret = pcmcia_enable_device(link); > + if (ret) > + return -ENODEV; And why not to return ret? -- With Best Regards, Andy Shevchenko