From patchwork Mon Oct 31 15:04:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9405641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78955601C0 for ; Mon, 31 Oct 2016 15:04:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74947292D8 for ; Mon, 31 Oct 2016 15:04:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69560292DE; Mon, 31 Oct 2016 15:04:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0555A292D8 for ; Mon, 31 Oct 2016 15:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943801AbcJaPEf (ORCPT ); Mon, 31 Oct 2016 11:04:35 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35924 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943793AbcJaPEe (ORCPT ); Mon, 31 Oct 2016 11:04:34 -0400 Received: by mail-pf0-f193.google.com with SMTP id n85so8965095pfi.3 for ; Mon, 31 Oct 2016 08:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zt5YKhmPj72+uRgAtnY+SLmHCmWIRLLfyu0dOofXrJo=; b=0kmD949pW3zLZIDh6lXU1uB3TwIg84zUCW4XTAY9vtmJKmKr99ii5T2aekPAWXtmJX SigxadmAO2ZX/sfFW0PRURtENLLcAmUxI2p6+YrW4lBN5ldRZjTvQ3vy8e09UuLWbqX7 X7yHmJ4C5av23Ylc8FODh2rleVkfwYCc9ah7q2Lq8qDJFj5EoyNlHsBkGf1DPDDd9WeG dmZOiqdTpM9jHUJBcKrJVIXObzJuu73ELjTynxx2YsjkGu6GFdgH7MMCClN9iFvdGTSO iRnMW+ZcohjAkB2SYVjnZNEkvMMRA5E/kiW4+/BzPU/7YjyeRzBBfQNqaCBBuq9sqzfi rQ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zt5YKhmPj72+uRgAtnY+SLmHCmWIRLLfyu0dOofXrJo=; b=UnJn56xHEjpJ5kARGfKLreoun454i6Z8jDFmmBVQtUXI/VfJjQifnmbUvs9jHLG61/ k/7x+RSN+ylIMb8uYY9zjlNUL8zkJfwF2Zi3cyfyVRnJkuiyDSlpQRP7ETOnokSd8ExC 1VNAIR12MnXUNNu6nOT4kF9n/6Swc161InrMd62w+CO3W8LIRkA/pk/mAVRPm0WnfoHQ O+bplQd0NLXYvip+bKre2rLRivZmdBq85f4vDcuTVbJli7YEIzclVyVSlq2zULrJFFrD 5eUqT8NfN1H183sIYPo3BCnzEV/Ohx2alhJrjiYX7gJYUikcWPf5+P4SP/6JqHbzRJ/J UfYQ== X-Gm-Message-State: ABUngvevJfa9EugkH4MIJCRzPn8EEJ6XVcQODTkR9TVEU3Vq02hQd8V75K9bbtPoFH3L6A== X-Received: by 10.99.157.78 with SMTP id i75mr41521960pgd.148.1477926273271; Mon, 31 Oct 2016 08:04:33 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id y2sm36335061pfk.54.2016.10.31.08.04.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2016 08:04:32 -0700 (PDT) From: Wei Yongjun To: "James E . J . Bottomley" , "Martin K. Petersen" , Wilfried Weissmann , Luis de Bethencourt , Johannes Thumshirn , Hannes Reinecke , Tejun Heo , Baoyou Xie Cc: Wei Yongjun , linux-scsi@vger.kernel.org Subject: [PATCH] mvsas: fix error return code in mvs_task_prep() Date: Mon, 31 Oct 2016 15:04:10 +0000 Message-Id: <1477926250-10292-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/scsi/mvsas/mv_sas.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index 86eb199..c7cc803 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -791,8 +791,10 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf slot->slot_tag = tag; slot->buf = pci_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma); - if (!slot->buf) + if (!slot->buf) { + rc = -ENOMEM; goto err_out_tag; + } memset(slot->buf, 0, MVS_SLOT_BUF_SZ); tei.task = task;