<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/lib/test_firmware.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-06-25T05:25:11+00:00</updated>
<entry>
<title>KUnit: add missing MODULE_DESCRIPTION() macros for lib/test_*.ko</title>
<updated>2024-06-25T05:25:11+00:00</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2024-06-19T20:59:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=303474913271af4eb3ec1c5f955d1e01682f3e1f'/>
<id>urn:sha1:303474913271af4eb3ec1c5f955d1e01682f3e1f</id>
<content type='text'>
make allmodconfig &amp;&amp; make W=1 C=1 reports for lib/test_*.ko:
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_hexdump.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_dhry.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_firmware.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_sysctl.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_hash.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_ida.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_list_sort.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_min_heap.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_module.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_sort.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_static_keys.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_static_key_base.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_memcat_p.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_blackhole_dev.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_meminit.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_free_pages.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_kprobes.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_ref_tracker.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_bits.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

Link: https://lkml.kernel.org/r/20240619-md-lib-test-v2-1-301e30eeba1e@quicinc.com
Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Reviewed-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: "Naveen N. Rao" &lt;naveen.n.rao@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>firmware_loader: Expand Firmware upload error codes with firmware invalid error</title>
<updated>2023-11-25T02:09:19+00:00</updated>
<author>
<name>Kory Maincent</name>
<email>kory.maincent@bootlin.com</email>
</author>
<published>2023-11-22T13:52:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a066f906ba396ab00d4af19fc5fad42b2605582a'/>
<id>urn:sha1:a066f906ba396ab00d4af19fc5fad42b2605582a</id>
<content type='text'>
No error code are available to signal an invalid firmware content.
Drivers that can check the firmware content validity can not return this
specific failure to the user-space

Expand the firmware error code with an additional code:
- "firmware invalid" code which can be used when the provided firmware
  is invalid

Sync lib/test_firmware.c file accordingly.

Acked-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Kory Maincent &lt;kory.maincent@bootlin.com&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://lore.kernel.org/r/20231122-feature_firmware_error_code-v3-1-04ec753afb71@bootlin.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation</title>
<updated>2023-06-15T11:42:18+00:00</updated>
<author>
<name>Mirsad Goran Todorovac</name>
<email>mirsad.todorovac@alu.unizg.hr</email>
</author>
<published>2023-06-06T07:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7dae593cd226a0bca61201cf85ceb9335cf63682'/>
<id>urn:sha1:7dae593cd226a0bca61201cf85ceb9335cf63682</id>
<content type='text'>
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 &lt;error27@gmail.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: "Luis R. Rodriguez" &lt;mcgrof@ruslug.rutgers.edu&gt;
Cc: Scott Branden &lt;sbranden@broadcom.com&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Brian Norris &lt;briannorris@chromium.org&gt;
Fixes: c92316bf8e948 ("test_firmware: add batched firmware tests")
Fixes: 0a8adf584759c ("test: add firmware_class loader test")
Fixes: 548193cba2a7d ("test_firmware: add support for firmware_request_platform")
Fixes: eb910947c82f9 ("test: firmware_class: add asynchronous request trigger")
Fixes: 061132d2b9c95 ("test_firmware: add test custom fallback trigger")
Fixes: 7feebfa487b92 ("test_firmware: add support for request_firmware_into_buf")
Signed-off-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Message-ID: &lt;20230606070808.9300-1-mirsad.todorovac@alu.unizg.hr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: fix the memory leak of the allocated firmware buffer</title>
<updated>2023-05-31T19:31:07+00:00</updated>
<author>
<name>Mirsad Goran Todorovac</name>
<email>mirsad.todorovac@alu.unizg.hr</email>
</author>
<published>2023-05-09T08:47:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48e156023059e57a8fc68b498439832f7600ffff'/>
<id>urn:sha1:48e156023059e57a8fc68b498439832f7600ffff</id>
<content type='text'>
The following kernel memory leak was noticed after running
tools/testing/selftests/firmware/fw_run_tests.sh:

[root@pc-mtodorov firmware]# cat /sys/kernel/debug/kmemleak
.
.
.
unreferenced object 0xffff955389bc3400 (size 1024):
  comm "test_firmware-0", pid 5451, jiffies 4294944822 (age 65.652s)
  hex dump (first 32 bytes):
    47 48 34 35 36 37 0a 00 00 00 00 00 00 00 00 00  GH4567..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff962f5dec&gt;] slab_post_alloc_hook+0x8c/0x3c0
    [&lt;ffffffff962fcca4&gt;] __kmem_cache_alloc_node+0x184/0x240
    [&lt;ffffffff962704de&gt;] kmalloc_trace+0x2e/0xc0
    [&lt;ffffffff9665b42d&gt;] test_fw_run_batch_request+0x9d/0x180
    [&lt;ffffffff95fd813b&gt;] kthread+0x10b/0x140
    [&lt;ffffffff95e033e9&gt;] ret_from_fork+0x29/0x50
unreferenced object 0xffff9553c334b400 (size 1024):
  comm "test_firmware-1", pid 5452, jiffies 4294944822 (age 65.652s)
  hex dump (first 32 bytes):
    47 48 34 35 36 37 0a 00 00 00 00 00 00 00 00 00  GH4567..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff962f5dec&gt;] slab_post_alloc_hook+0x8c/0x3c0
    [&lt;ffffffff962fcca4&gt;] __kmem_cache_alloc_node+0x184/0x240
    [&lt;ffffffff962704de&gt;] kmalloc_trace+0x2e/0xc0
    [&lt;ffffffff9665b42d&gt;] test_fw_run_batch_request+0x9d/0x180
    [&lt;ffffffff95fd813b&gt;] kthread+0x10b/0x140
    [&lt;ffffffff95e033e9&gt;] ret_from_fork+0x29/0x50
unreferenced object 0xffff9553c334f000 (size 1024):
  comm "test_firmware-2", pid 5453, jiffies 4294944822 (age 65.652s)
  hex dump (first 32 bytes):
    47 48 34 35 36 37 0a 00 00 00 00 00 00 00 00 00  GH4567..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff962f5dec&gt;] slab_post_alloc_hook+0x8c/0x3c0
    [&lt;ffffffff962fcca4&gt;] __kmem_cache_alloc_node+0x184/0x240
    [&lt;ffffffff962704de&gt;] kmalloc_trace+0x2e/0xc0
    [&lt;ffffffff9665b42d&gt;] test_fw_run_batch_request+0x9d/0x180
    [&lt;ffffffff95fd813b&gt;] kthread+0x10b/0x140
    [&lt;ffffffff95e033e9&gt;] ret_from_fork+0x29/0x50
unreferenced object 0xffff9553c3348400 (size 1024):
  comm "test_firmware-3", pid 5454, jiffies 4294944822 (age 65.652s)
  hex dump (first 32 bytes):
    47 48 34 35 36 37 0a 00 00 00 00 00 00 00 00 00  GH4567..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff962f5dec&gt;] slab_post_alloc_hook+0x8c/0x3c0
    [&lt;ffffffff962fcca4&gt;] __kmem_cache_alloc_node+0x184/0x240
    [&lt;ffffffff962704de&gt;] kmalloc_trace+0x2e/0xc0
    [&lt;ffffffff9665b42d&gt;] test_fw_run_batch_request+0x9d/0x180
    [&lt;ffffffff95fd813b&gt;] kthread+0x10b/0x140
    [&lt;ffffffff95e033e9&gt;] ret_from_fork+0x29/0x50
[root@pc-mtodorov firmware]#

Note that the size 1024 corresponds to the size of the test firmware
buffer. The actual number of the buffers leaked is around 70-110,
depending on the test run.

The cause of the leak is the following:

request_partial_firmware_into_buf() and request_firmware_into_buf()
provided firmware buffer isn't released on release_firmware(), we
have allocated it and we are responsible for deallocating it manually.
This is introduced in a number of context where previously only
release_firmware() was called, which was insufficient.

Reported-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Fixes: 7feebfa487b92 ("test_firmware: add support for request_firmware_into_buf")
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Cc: Russ Weight &lt;russell.h.weight@intel.com&gt;
Cc: Tianfei zhang &lt;tianfei.zhang@intel.com&gt;
Cc: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Cc: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Cc: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Cc: linux-kernel@vger.kernel.org
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Scott Branden &lt;sbranden@broadcom.com&gt;
Cc: Luis R. Rodriguez &lt;mcgrof@kernel.org&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: stable@vger.kernel.org # v5.4
Signed-off-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Link: https://lore.kernel.org/r/20230509084746.48259-3-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: fix a memory leak with reqs buffer</title>
<updated>2023-05-31T19:31:07+00:00</updated>
<author>
<name>Mirsad Goran Todorovac</name>
<email>mirsad.todorovac@alu.unizg.hr</email>
</author>
<published>2023-05-09T08:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be37bed754ed90b2655382f93f9724b3c1aae847'/>
<id>urn:sha1:be37bed754ed90b2655382f93f9724b3c1aae847</id>
<content type='text'>
Dan Carpenter spotted that test_fw_config-&gt;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 trigger by the tests, but observed by Dan's visual
inspection of the code.

The recommended workaround was to return -EBUSY if test_fw_config-&gt;reqs
is already allocated.

Fixes: 7feebfa487b92 ("test_firmware: add support for request_firmware_into_buf")
Cc: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Russ Weight &lt;russell.h.weight@intel.com&gt;
Cc: Tianfei Zhang &lt;tianfei.zhang@intel.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: stable@vger.kernel.org # v5.4
Suggested-by: Dan Carpenter &lt;error27@gmail.com&gt;
Suggested-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Acked-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Link: https://lore.kernel.org/r/20230509084746.48259-2-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: prevent race conditions by a correct implementation of locking</title>
<updated>2023-05-31T19:31:07+00:00</updated>
<author>
<name>Mirsad Goran Todorovac</name>
<email>mirsad.todorovac@alu.unizg.hr</email>
</author>
<published>2023-05-09T08:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4acfe3dfde685a5a9eaec5555351918e2d7266a1'/>
<id>urn:sha1:4acfe3dfde685a5a9eaec5555351918e2d7266a1</id>
<content type='text'>
Dan Carpenter spotted a race condition in a couple of situations like
these in the test_firmware driver:

static int test_dev_config_update_u8(const char *buf, size_t size, u8 *cfg)
{
        u8 val;
        int ret;

        ret = kstrtou8(buf, 10, &amp;val);
        if (ret)
                return ret;

        mutex_lock(&amp;test_fw_mutex);
        *(u8 *)cfg = val;
        mutex_unlock(&amp;test_fw_mutex);

        /* Always return full write size even if we didn't consume all */
        return size;
}

static ssize_t config_num_requests_store(struct device *dev,
                                         struct device_attribute *attr,
                                         const char *buf, size_t count)
{
        int rc;

        mutex_lock(&amp;test_fw_mutex);
        if (test_fw_config-&gt;reqs) {
                pr_err("Must call release_all_firmware prior to changing config\n");
                rc = -EINVAL;
                mutex_unlock(&amp;test_fw_mutex);
                goto out;
        }
        mutex_unlock(&amp;test_fw_mutex);

        rc = test_dev_config_update_u8(buf, count,
                                       &amp;test_fw_config-&gt;num_requests);

out:
        return rc;
}

static ssize_t config_read_fw_idx_store(struct device *dev,
                                        struct device_attribute *attr,
                                        const char *buf, size_t count)
{
        return test_dev_config_update_u8(buf, count,
                                         &amp;test_fw_config-&gt;read_fw_idx);
}

The function test_dev_config_update_u8() is called from both the locked
and the unlocked context, function config_num_requests_store() and
config_read_fw_idx_store() which can both be called asynchronously as
they are driver's methods, while test_dev_config_update_u8() and siblings
change their argument pointed to by u8 *cfg or similar pointer.

To avoid deadlock on test_fw_mutex, the lock is dropped before calling
test_dev_config_update_u8() and re-acquired within test_dev_config_update_u8()
itself, but alas this creates a race condition.

Having two locks wouldn't assure a race-proof mutual exclusion.

This situation is best avoided by the introduction of a new, unlocked
function __test_dev_config_update_u8() which can be called from the locked
context and reducing test_dev_config_update_u8() to:

static int test_dev_config_update_u8(const char *buf, size_t size, u8 *cfg)
{
        int ret;

        mutex_lock(&amp;test_fw_mutex);
        ret = __test_dev_config_update_u8(buf, size, cfg);
        mutex_unlock(&amp;test_fw_mutex);

        return ret;
}

doing the locking and calling the unlocked primitive, which enables both
locked and unlocked versions without duplication of code.

The similar approach was applied to all functions called from the locked
and the unlocked context, which safely mitigates both deadlocks and race
conditions in the driver.

__test_dev_config_update_bool(), __test_dev_config_update_u8() and
__test_dev_config_update_size_t() unlocked versions of the functions
were introduced to be called from the locked contexts as a workaround
without releasing the main driver's lock and thereof causing a race
condition.

The test_dev_config_update_bool(), test_dev_config_update_u8() and
test_dev_config_update_size_t() locked versions of the functions
are being called from driver methods without the unnecessary multiplying
of the locking and unlocking code for each method, and complicating
the code with saving of the return value across lock.

Fixes: 7feebfa487b92 ("test_firmware: add support for request_firmware_into_buf")
Cc: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Russ Weight &lt;russell.h.weight@intel.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tianfei Zhang &lt;tianfei.zhang@intel.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: stable@vger.kernel.org # v5.4
Suggested-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Link: https://lore.kernel.org/r/20230509084746.48259-1-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: Use kstrtobool() instead of strtobool()</title>
<updated>2023-01-20T13:09:47+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-01-14T09:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f7d85515bd21902b218370a1a6301f76e4e636ff'/>
<id>urn:sha1:f7d85515bd21902b218370a1a6301f76e4e636ff</id>
<content type='text'>
strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.

In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.

While at it, include the corresponding header file (&lt;linux/kstrtox.h&gt;)

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Link: https://lore.kernel.org/r/34f04735d20e0138695dd4070651bd860a36b81c.1673688120.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: use kernel-doc struct notation</title>
<updated>2023-01-20T13:09:41+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2023-01-02T21:15:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ad5288f2bd37818fc90b77635611110c44df104'/>
<id>urn:sha1:1ad5288f2bd37818fc90b77635611110c44df104</id>
<content type='text'>
Add "struct" to the kernel-doc notation to prevent a warning:

lib/test_firmware.c:98: warning: cannot understand function prototype: 'struct test_config '

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Cc: Russ Weight &lt;russell.h.weight@intel.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Link: https://lore.kernel.org/r/20230102211554.25629-1-rdunlap@infradead.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: fix memory leak in test_firmware_init()</title>
<updated>2022-11-23T18:49:13+00:00</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-11-19T03:57:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7610615e8cdb3f6f5bbd9d8e7a5d8a63e3cabf2e'/>
<id>urn:sha1:7610615e8cdb3f6f5bbd9d8e7a5d8a63e3cabf2e</id>
<content type='text'>
When misc_register() failed in test_firmware_init(), the memory pointed
by test_fw_config-&gt;name is not released. The memory leak information is
as follows:
unreferenced object 0xffff88810a34cb00 (size 32):
  comm "insmod", pid 7952, jiffies 4294948236 (age 49.060s)
  hex dump (first 32 bytes):
    74 65 73 74 2d 66 69 72 6d 77 61 72 65 2e 62 69  test-firmware.bi
    6e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  n...............
  backtrace:
    [&lt;ffffffff81b21fcb&gt;] __kmalloc_node_track_caller+0x4b/0xc0
    [&lt;ffffffff81affb96&gt;] kstrndup+0x46/0xc0
    [&lt;ffffffffa0403a49&gt;] __test_firmware_config_init+0x29/0x380 [test_firmware]
    [&lt;ffffffffa040f068&gt;] 0xffffffffa040f068
    [&lt;ffffffff81002c41&gt;] do_one_initcall+0x141/0x780
    [&lt;ffffffff816a72c3&gt;] do_init_module+0x1c3/0x630
    [&lt;ffffffff816adb9e&gt;] load_module+0x623e/0x76a0
    [&lt;ffffffff816af471&gt;] __do_sys_finit_module+0x181/0x240
    [&lt;ffffffff89978f99&gt;] do_syscall_64+0x39/0xb0
    [&lt;ffffffff89a0008b&gt;] entry_SYSCALL_64_after_hwframe+0x63/0xcd

Fixes: c92316bf8e94 ("test_firmware: add batched firmware tests")
Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Acked-by: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Link: https://lore.kernel.org/r/20221119035721.18268-1-shaozhengchao@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>test_firmware: Fix spelling mistake "EMTPY" -&gt; "EMPTY"</title>
<updated>2022-11-10T17:51:49+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.i.king@gmail.com</email>
</author>
<published>2022-09-28T21:16:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d88bd098f45e0dcf317f8924a38b48e8a14a3854'/>
<id>urn:sha1:d88bd098f45e0dcf317f8924a38b48e8a14a3854</id>
<content type='text'>
There are spelling mistakes in config show text. Fix these.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Reviewed-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Link: https://lore.kernel.org/r/20220928211637.62529-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
