From patchwork Fri Aug 4 16:53:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 131272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cbc7:0:b0:3e9:de7a:15be with SMTP id f7csp1882548vqv; Fri, 4 Aug 2023 10:35:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEirzZdENe3LBS7TWeQAMV1tdYsb1TchtNHUiV3YYKaBmtiRa5uhu2podFltArH7ZAavxgz X-Received: by 2002:a17:902:eccf:b0:1b6:bced:1dd6 with SMTP id a15-20020a170902eccf00b001b6bced1dd6mr2518348plh.35.1691170518902; Fri, 04 Aug 2023 10:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691170518; cv=none; d=google.com; s=arc-20160816; b=SF8JJjsGK+HsSaF07T1MbwzNnQvkmIxd0eJY5FRHOnarMcpB0tWDPQ5kAAqnuG01Vq CkmydEwi9475ZYFdC2SfEY+AaJbpAd1FMkdhnrY4h+jJCmGD7FsWSpZROQoiScCvWy95 oAeSc+UppCjFmW7f7BoxV6Q5N/EaRtIQeC9HKRLFc9sEky3gbPYdhlVjuZDq8y6LRoQ0 2IeH8abwnbLcYchSuGM9ispgWLKxH7lFfkoQVEKx00kE8QDx8h1fspjmn0Ir1eoFZtvw uw0xnLJwWiSlRcqA4aaHksYIpr6B1B2ttRdUMrFdZACcRJ9lECGGtRQM2G0gy1xHoXRR bK3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=mJFBAquxpBs6VdgqUc6cLPhqpzh07gjVX4Q7aFGzTG8=; fh=5KvHHUcfBIBdmMH027jnTfWRuOqaKbgBg3g3ce4VP5A=; b=lIdGdKzIAe+wNFgiBmfJFjcaWjofFOZb4RRBrLBQggyeFX6/atNA/lEkuWpIWOErmc mr6fJDr3OefHp0lUm4DdsIon+5/KFG11WCnxpTTglYhmJaCG0GloCfp/ueQ3dkf2DZLL QXDkvS9a7cZ2eBM8ISlR/y6F9BoC6hi0rpQxHoqrA5GjU74g+Pw0imR9+K3BZWLU2Ih1 RZZe/SSyS2xIGxBRV4iF+kEaygL9pRBAiLTDl0RMNOWPY2Ze3lhmV9GZz8xhRH69Bz+8 eI7WuhTvZ3ne9imSDdPZLnf164ejNSdjFJAH9Cpl3FXCim7jy3nxhE6vCKbOthuPj53p vHvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=Lvq2XEfE; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b="qAR4TZQ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a170902c94200b001bbfbe6bf3esi2083473pla.504.2023.08.04.10.35.04; Fri, 04 Aug 2023 10:35:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=Lvq2XEfE; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b="qAR4TZQ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231315AbjHDQzy (ORCPT + 99 others); Fri, 4 Aug 2023 12:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbjHDQzw (ORCPT ); Fri, 4 Aug 2023 12:55:52 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [IPv6:2001:b68:2:2800::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390A3422B; Fri, 4 Aug 2023 09:55:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 7EA3960177; Fri, 4 Aug 2023 18:55:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1691168144; bh=jGKArOHB9A/vE1VyN1TzB7/9WlyDQkSbKJ/qSRlrg4Y=; h=From:To:Cc:Subject:Date:From; b=Lvq2XEfE5l92EkNlNdNhmi5dOFDJqg0P27OgthGyexVw/muoggPy19Z/MtgGbxuGK Gximh2eGIRnyqvnn3RtCEe4NfNB86/v7IauGF1auuC3ZwTl22756htbNNoWLs7ZcrO 0XJIgVr9fyhGSA20LyciUAVIrhU330GfD7IxRLsTH0vGXPX340377zn6n8sAWuRlAr YbEjJQrLnSoASysqQSsMynN244431zJnlRAnD4E9unTvVBsI+OY029ZhZD0hAVy9JR km8sVJz+AVlOU5Zzkw2qY2ujyl7tJuH7+WjHCyLX+CLqYKi1yBs1mw23RulUlcA8L3 s7kZLdMjkrn6w== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kBv9sbNghrv6; Fri, 4 Aug 2023 18:55:41 +0200 (CEST) Received: from defiant.. (unknown [94.250.191.183]) by domac.alu.hr (Postfix) with ESMTPSA id EC2E560174; Fri, 4 Aug 2023 18:55:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1691168141; bh=jGKArOHB9A/vE1VyN1TzB7/9WlyDQkSbKJ/qSRlrg4Y=; h=From:To:Cc:Subject:Date:From; b=qAR4TZQ/gjjpKyr7+3vOmYASKTSG8wSaJaJw+xgTNXZszy/eJYvqn+75UoZzHxHfS MIc9FUyHn88MjS5iFfWafxHfhm7q0PlJMyLRSk6//wDpZF3sLS8AUEzELV2p6wqrua 54UBVULx9cE6WJ8ykp54cEQ601XEkl1GapI49wg4rx8Z7Wkppa3OkDLuYFsZyFmUZE AK7oOYMni5iboWcWS72hYrKasipH/ccJUwck5wVuhQIlMB0kLC1vpo8ObxNRqiYxT8 grR1nDoP+lAFw7q8QY33UpkYFpyuclLW+anE3sQvQ6HAs603ne63642tWDnGVcezA2 wxelq2g3IYwDA== From: Mirsad Todorovac To: Mirsad Todorovac , linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Greg Kroah-Hartman , Russ Weight , Tianfei Zhang , Shuah Khan , Colin Ian King , Randy Dunlap , linux-kselftest@vger.kernel.org, stable@vger.kernel.org, Dan Carpenter , Takashi Iwai Subject: [PATCH v3 4.19 1/2] test_firmware: fix a memory leak with reqs buffer Date: Fri, 4 Aug 2023 18:53:21 +0200 Message-Id: <20230804165321.92163-1-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773320817684153175 X-GMAIL-MSGID: 1773320817684153175 [ commit be37bed754ed90b2655382f93f9724b3c1aae847 upstream ] Dan Carpenter spotted that test_fw_config->reqs will be leaked if trigger_batched_requests_store() is called two or more times. The same appears with trigger_batched_requests_async_store(). This bug wasn't triggered by the tests, but observed by Dan's visual inspection of the code. The recommended workaround was to return -EBUSY if test_fw_config->reqs is already allocated. Fixes: c92316bf8e94 ("test_firmware: add batched firmware tests") Cc: Luis Chamberlain Cc: Greg Kroah-Hartman Cc: Russ Weight Cc: Tianfei Zhang Cc: Shuah Khan Cc: Colin Ian King Cc: Randy Dunlap Cc: linux-kselftest@vger.kernel.org Cc: stable@vger.kernel.org # v4.19 Suggested-by: Dan Carpenter Suggested-by: Takashi Iwai Link: https://lore.kernel.org/r/20230509084746.48259-2-mirsad.todorovac@alu.unizg.hr Signed-off-by: Mirsad Todorovac [ This is a backport to v4.19 stable branch without a change in code from the 5.4+ patch ] --- v2: no changes to commit. minor clarifications with versioning for the patchwork. v1: patch sumbmitted verbatim from the 5.4+ branch to 4.19 lib/test_firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/test_firmware.c b/lib/test_firmware.c index f4cc874021da..e4688821eab8 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -618,6 +618,11 @@ static ssize_t trigger_batched_requests_store(struct device *dev, mutex_lock(&test_fw_mutex); + if (test_fw_config->reqs) { + rc = -EBUSY; + goto out_bail; + } + test_fw_config->reqs = vzalloc(array3_size(sizeof(struct test_batched_req), test_fw_config->num_requests, 2)); @@ -721,6 +726,11 @@ ssize_t trigger_batched_requests_async_store(struct device *dev, mutex_lock(&test_fw_mutex); + if (test_fw_config->reqs) { + rc = -EBUSY; + goto out_bail; + } + test_fw_config->reqs = vzalloc(array3_size(sizeof(struct test_batched_req), test_fw_config->num_requests, 2)); From patchwork Fri Aug 4 16:53:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 131286 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:1a9a:b0:139:fa0d:b2d with SMTP id gm26csp105752rwb; Fri, 4 Aug 2023 10:59:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2oqa52OA+Da1M76i6wnu2Cyqpixz2iizoTqnVY5gaW8ebPcDkIKizgSU+k84sofVf/Mpk X-Received: by 2002:aa7:de14:0:b0:51d:e3d2:f5eb with SMTP id h20-20020aa7de14000000b0051de3d2f5ebmr2287488edv.5.1691171976098; Fri, 04 Aug 2023 10:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691171976; cv=none; d=google.com; s=arc-20160816; b=eRurzeRV65ywBUcjxpLaNq5PwwqrvBzzm6/Yi7EH2lnddtxycGxV25UCUyTIlVEYAj mzQUxhzlZRQ1UzqlS2pPwD39brvJpm8xk33C/iJg4dx14HrD2wudFv0obmxxjm3KOSqd l24i2skTgQhYXnszJfn829Kkb+7ZmQ05fbZDMWpX68I4wPtHyforV5h2/Zt24VUc4N6b PUgGsRPnkQjcZr6croBGZk890RZMJmFDcIZ87v40uLvgSZjRE2PdrPExi+nfd0RYJQc0 0s4saJ4ibkUN7T7JS5ooMSaksIT3fVTMguRmT2o2OfiatOwDTCSRBqFQvIGx0wkuxi5h p9nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=F7UeOmzMabTr58tBlOaKjSnKlFh7FH2ouvMSC/glkNE=; fh=RV8yYhM1c3saQodyFDnv7ypfdxgbmHytZEV/59A5jn0=; b=ca8YbKGj5Ku1Odseyp2TTyCHJoDHUprCtEvaPSUf6nmuAsvljsVXrmTx2lzc5K6ifC iNPvSbEu1zJiGQmwO93Sqe9vBkYLlBWtc0IZB6XSrSjFJU/LbvaAUFLxShiqsXTwVuBP CJQ3My5zfsJ5Xii5QZmn7H1eLJZFmFl6LvB6NQ2596zX7eKyWxlAR/SVt8jpH9ztSno6 7VISKsuBwFnJ8omhW00Woj8Lr5dzgZN2FcsNKKwfkJiNH9nL6+w/ehBRthzHPeF+Uve4 YKVfpUXTPD7KJldmItk8vnh11JJhCjbrHq3ma/LBpU1Yb+os8GDe3f5sLVWuLX3+gtos 349Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=vreioAkm; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=T9MxCLuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020aa7d04e000000b00521e784bbbesi1299043edo.15.2023.08.04.10.59.12; Fri, 04 Aug 2023 10:59:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=vreioAkm; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=T9MxCLuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231351AbjHDQ5T (ORCPT + 99 others); Fri, 4 Aug 2023 12:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjHDQ5S (ORCPT ); Fri, 4 Aug 2023 12:57:18 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017F7198B; Fri, 4 Aug 2023 09:57:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 3ADCA60177; Fri, 4 Aug 2023 18:57:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1691168235; bh=3pO4ASe2Rzwm3FUFHEkivkWRWqhULtw+aTw1zJGZjmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vreioAkmf/qehNVmhzht4oP7bZ/JTEaMCqCXzBjMopwjm65/IZHQFKHncjFc37s8y QHIPWUEYj6A6cXcDPOZ8fACnIbirL1Mtwv9eDuInOCYUy/2hozApKcK3kfBVCcXTQJ 3VdFJQssHmMtcWUBuxF8WCpNSWQgfjcllsBNnhii7b2YSD7eV34sZSm8JYjY7/eQQM rmaT/2NzSywdtGQ9EunzNCpYT9e0SBYZvx6b3tEbf1ojgV9qO7S9AuUpsWnmGhxEVI YbJrP6quxKBiCWI0nrjCrWYSm4SP4q394aEv2ImCTjovWXbu+09EY3A8UbUSsYLzGH 6PBJVElU2/pdA== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J24Tgs8Bafjn; Fri, 4 Aug 2023 18:57:12 +0200 (CEST) Received: from defiant.. (unknown [94.250.191.183]) by domac.alu.hr (Postfix) with ESMTPSA id 8639A60174; Fri, 4 Aug 2023 18:57:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1691168232; bh=3pO4ASe2Rzwm3FUFHEkivkWRWqhULtw+aTw1zJGZjmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9MxCLuMzRqZ7/ry+rC7ynGvw5L0UpnVx+7zwF1StZGBdOvD9ghnQpXgYIF4ElvHt pWlCGf5eBObyA/Fr2hXuue3GqBrsiu2YUdhaKRrV3mfuXsy5/BV9r+rESWabe5mfoc JJGmOXYDcgMGblrMmsaqkKDkD357J2TRII6uwC2hHIXh4J95V+YIVSW2bFqAq8CWow JmiTR9pGmfXoviM2SBUpbVzcCiq9EmbO4FJuqAKajqu9RHtYNn8DmR1h2w5klEz3F9 T29txfIPzOxDlwchFyE4DXhZOWlOUaQWz57VaIq/rblQHf5Ghbgj6mglvGLdH20GSC exegF1AQ00BGw== From: Mirsad Todorovac To: Mirsad Todorovac , linux-kernel@vger.kernel.org Cc: Dan Carpenter , Takashi Iwai , Kees Cook , "Luis R . Rodriguez" , Brian Norris , stable@vger.kernel.org Subject: [PATCH v3 4.19 2/2] test_firmware: return -ENOMEM instead of -ENOSPC on failed memory allocation Date: Fri, 4 Aug 2023 18:53:23 +0200 Message-Id: <20230804165321.92163-2-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230804165321.92163-1-mirsad.todorovac@alu.unizg.hr> References: <20230804165321.92163-1-mirsad.todorovac@alu.unizg.hr> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773322346027112134 X-GMAIL-MSGID: 1773322346027112134 [ Upstream commit 7dae593cd226a0bca61201cf85ceb9335cf63682 ] In a couple of situations like name = kstrndup(buf, count, GFP_KERNEL); if (!name) return -ENOSPC; the error is not actually "No space left on device", but "Out of memory". It is semantically correct to return -ENOMEM in all failed kstrndup() and kzalloc() cases in this driver, as it is not a problem with disk space, but with kernel memory allocator failing allocation. The semantically correct should be: name = kstrndup(buf, count, GFP_KERNEL); if (!name) return -ENOMEM; Cc: Dan Carpenter Cc: Takashi Iwai Cc: Kees Cook Cc: Luis R. Rodriguez Cc: Brian Norris Cc: stable@vger.kernel.org # 4.19, 4.14 Fixes: c92316bf8e948 ("test_firmware: add batched firmware tests") Fixes: 0a8adf584759c ("test: add firmware_class loader test") Fixes: eb910947c82f9 ("test: firmware_class: add asynchronous request trigger") Fixes: 061132d2b9c95 ("test_firmware: add test custom fallback trigger") Link: https://lore.kernel.org/all/20230606070808.9300-1-mirsad.todorovac@alu.unizg.hr/ Signed-off-by: Mirsad Todorovac [ This is the backport of the patch to 4.19 and 4.14 branches. There are no ] [ semantic differences in the commit. The same fix applies to 4.19 and 4.14 ] [ tree. The backport is provided for completenes sake so the bug would be fixed ] [ for all of the supported LTS kernels ] --- v2 -> v3: minor clarifications with the versioning for the patchwork. no change to commit. v1 -> v2: removed the Reviewed-by: and Acked-by tags, as this is a slightly different patch and those need to be reacquired lib/test_firmware.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/test_firmware.c b/lib/test_firmware.c index e4688821eab8..b5e779bcfb34 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -160,7 +160,7 @@ static int __kstrncpy(char **dst, const char *name, size_t count, gfp_t gfp) { *dst = kstrndup(name, count, gfp); if (!*dst) - return -ENOSPC; + return -ENOMEM; return count; } @@ -456,7 +456,7 @@ static ssize_t trigger_request_store(struct device *dev, name = kstrndup(buf, count, GFP_KERNEL); if (!name) - return -ENOSPC; + return -ENOMEM; pr_info("loading '%s'\n", name); @@ -497,7 +497,7 @@ static ssize_t trigger_async_request_store(struct device *dev, name = kstrndup(buf, count, GFP_KERNEL); if (!name) - return -ENOSPC; + return -ENOMEM; pr_info("loading '%s'\n", name); @@ -540,7 +540,7 @@ static ssize_t trigger_custom_fallback_store(struct device *dev, name = kstrndup(buf, count, GFP_KERNEL); if (!name) - return -ENOSPC; + return -ENOMEM; pr_info("loading '%s' using custom fallback mechanism\n", name);