From patchwork Wed Sep 20 06:17:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 9960879 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 79FD0601D5 for ; Wed, 20 Sep 2017 06:18:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CCA228802 for ; Wed, 20 Sep 2017 06:18:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61DE228FA6; Wed, 20 Sep 2017 06:18:15 +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=-1.5 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB,T_DKIM_INVALID autolearn=no 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 2B76428802 for ; Wed, 20 Sep 2017 06:18:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565AbdITGSC (ORCPT ); Wed, 20 Sep 2017 02:18:02 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33959 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751463AbdITGSB (ORCPT ); Wed, 20 Sep 2017 02:18:01 -0400 Received: by mail-pg0-f65.google.com with SMTP id u18so1129941pgo.1; Tue, 19 Sep 2017 23:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gRiVMas+bWTDacQf1LbGYMAUeumSj4+8OEjZiypeKLQ=; b=VrHDyAiz83wIUIY8P5aaU6bxiHrDgW4A8hSDFNy+Zp7B4thZchZCsLZrv0YBSvA1wI wpA+mjZFC13eJMw0hIEtr6deijm5VJJpbIuYJKkrubXYb8fqFHqldxiJU3HYFDlxyFFy UjSbco/Hx2w8clfYP75d6cXc3NuA3q6kVsiW80mrDqS4xfQoB8PZD63eEbAaelcEwTVP ab8mue+KTwhAuF1mnVHV2SM4lm4pSgTN4X2oYQoiSH8rULPv+BGHhBtr9N4djrt7l4XE 32Opgokc29R76xwopp4nAtyvq1/NRtCac6XvrfZlGigbIxZ25mmf1fLU5z2sHwy1ok1y Yvtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gRiVMas+bWTDacQf1LbGYMAUeumSj4+8OEjZiypeKLQ=; b=WCSaU/dfDducWk2xlwmR05z1mdYTtQ+l9XkXXOQF0Z1jBsvJ7c94RQRjTSvKoj+nox XIc6tQzi/yCOnD8vI68hjxOwVUXABUmp36PKUxqLF+FHu15rtxt2cAdvt8W3XaPVgwuw udGYPzKzZgWlNojcdPyf7E8Ol4dfwEJMQ3qGshYxe2jkCaHM2P3qKvpGSc0lu7Jw99ii 0bcNwx1R5iBxkKYHuC65MUVgfBKIWLPtg9kpQDbZPfQ8e5u5OJ0UG6/UJQKJssw4OhvB h75M7/7NzSevlJhP7btFYCOXFLHd0KLTPKP33YYSdDWotBiL9LmI1E2FVkgJDFMwiv3s GCnA== X-Gm-Message-State: AHPjjUgwo3tS1i1eUH4nSZhm9KBHCUOoYS6SMFcra/unmB/BoBTIGVUW bYiHsSfihwGa6T6jXip9KPosiR87 X-Google-Smtp-Source: AOwi7QC2EOhbJQqDFEcYI4HwwAb70ejnUDNR3OybLpOhArs6YCNtUCCDoFtsfxZSUKyeTWzjuclYCw== X-Received: by 10.99.63.135 with SMTP id m129mr1104281pga.207.1505888280369; Tue, 19 Sep 2017 23:18:00 -0700 (PDT) Received: from localhost.localdomain ([103.42.74.194]) by smtp.gmail.com with ESMTPSA id o79sm5376521pfi.108.2017.09.19.23.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 23:17:59 -0700 (PDT) From: Allen Pais To: linux-kernel@vger.kernel.org Cc: clm@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, Allen Pais Subject: [PATCH v2] fs:btrfs: return -ENOMEM on allocation failure. Date: Wed, 20 Sep 2017 11:47:46 +0530 Message-Id: <1505888266-23526-1-git-send-email-allen.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v2: return -ENOMEM from btrfsic_dev_state_alloc() too. Signed-off-by: Allen Pais Reviewed-by: Anand Jain --- fs/btrfs/check-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 7d5a9b5..9db1e76 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -2913,7 +2913,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, state = kvzalloc(sizeof(*state), GFP_KERNEL); if (!state) { pr_info("btrfs check-integrity: allocation failed!\n"); - return -1; + return -ENOMEM; } if (!btrfsic_is_initialized) { @@ -2945,7 +2945,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, if (NULL == ds) { pr_info("btrfs check-integrity: kmalloc() failed!\n"); mutex_unlock(&btrfsic_mutex); - return -1; + return -ENOMEM; } ds->bdev = device->bdev; ds->state = state;