<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mtd/devices/phram.c, branch linux-5.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-04-23T08:38:26Z</updated>
<entry>
<title>mtd: phram: fix a double free issue in error path</title>
<updated>2020-04-23T08:38:26Z</updated>
<author>
<name>Wen Yang</name>
</author>
<published>2020-03-18T15:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce2a7dc84beeee70d429922ce0ccd1cc158c5683'/>
<id>urn:sha1:ce2a7dc84beeee70d429922ce0ccd1cc158c5683</id>
<content type='text'>
commit 49c64df880570034308e4a9a49c4bc95cf8cdb33 upstream.

The variable 'name' is released multiple times in the error path,
which may cause double free issues.
This problem is avoided by adding a goto label to release the memory
uniformly. And this change also makes the code a bit more cleaner.

Fixes: 4f678a58d335 ("mtd: fix memory leaks in phram_setup")
Signed-off-by: Wen Yang &lt;wenyang@linux.alibaba.com&gt;
Cc: Joern Engel &lt;joern@lazybastard.org&gt;
Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Vignesh Raghavendra &lt;vigneshr@ti.com&gt;
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20200318153156.25612-1-wenyang@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mtd: phram: Module parameters add writable permissions</title>
<updated>2019-09-15T21:50:38Z</updated>
<author>
<name>Xiaoming Ni</name>
</author>
<published>2019-07-14T03:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3d45ac21e464f24cb97b3f6cc68be8eef7f7b56'/>
<id>urn:sha1:f3d45ac21e464f24cb97b3f6cc68be8eef7f7b56</id>
<content type='text'>
The phram code implements managing multiple devices through a linked
list.
However, due to the module parameter permission of 0, the
/sys/module/phram/parameters/phram interface is missing.
The command line arguments in insmod can only create one device.

Therefore, add writable permissions to the module parameters, create
/sys/module/phram/parameters/phram interface, and create multi-device
support.

Signed-off-by: Xiaoming Ni &lt;nixiaoming@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier for more missed files</title>
<updated>2019-05-21T08:50:45Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-19T12:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09c434b8a0047c69e48499de0107de312901e798'/>
<id>urn:sha1:09c434b8a0047c69e48499de0107de312901e798</id>
<content type='text'>
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have MODULE_LICENCE("GPL*") inside which was used in the initial
   scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mtd: phram: Mark expected switch fall-throughs</title>
<updated>2019-05-06T19:57:05Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2019-02-08T18:09:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=098d74b4eaf63b7ab13ebdac4ad95f6b214b5f62'/>
<id>urn:sha1:098d74b4eaf63b7ab13ebdac4ad95f6b214b5f62</id>
<content type='text'>
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/mtd/devices/phram.c: In function ‘parse_num64’:
drivers/mtd/devices/phram.c:149:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
     shift += 10;
     ~~~~~~^~~~~
drivers/mtd/devices/phram.c:150:4: note: here
    case 'M':
    ^~~~
drivers/mtd/devices/phram.c:151:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
     shift += 10;
     ~~~~~~^~~~~
drivers/mtd/devices/phram.c:152:4: note: here
    case 'k':
    ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>mtd: Stop updating erase_info-&gt;state and calling mtd_erase_callback()</title>
<updated>2018-03-21T08:50:56Z</updated>
<author>
<name>Boris Brezillon</name>
</author>
<published>2018-02-12T21:03:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e'/>
<id>urn:sha1:e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e</id>
<content type='text'>
MTD users are no longer checking erase_info-&gt;state to determine if the
erase operation failed or succeeded. Moreover, mtd_erase_callback() is
now a NOP.

We can safely get rid of all mtd_erase_callback() calls and all
erase_info-&gt;state assignments. While at it, get rid of the
erase_info-&gt;state field, all MTD_ERASE_XXX definitions and the
mtd_erase_callback() function.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Acked-by: Bert Kenward &lt;bkenward@solarflare.com&gt;
---
Changes in v2:
- Address a few coding style issues (reported by Miquel)
- Remove comments that are no longer valid (reported by Miquel)
</content>
</entry>
<entry>
<title>treewide: Fix function prototypes for module_param_call()</title>
<updated>2017-10-31T14:30:37Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2017-10-18T02:04:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4dca7b7aa08b22893c45485d222b5807c1375ae'/>
<id>urn:sha1:e4dca7b7aa08b22893c45485d222b5807c1375ae</id>
<content type='text'>
Several function prototypes for the set/get functions defined by
module_param_call() have a slightly wrong argument types. This fixes
those in an effort to clean up the calls when running under type-enforced
compiler instrumentation for CFI. This is the result of running the
following semantic patch:

@match_module_param_call_function@
declarer name module_param_call;
identifier _name, _set_func, _get_func;
expression _arg, _mode;
@@

 module_param_call(_name, _set_func, _get_func, _arg, _mode);

@fix_set_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._set_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _set_func(
-_val_type _val
+const char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

@fix_get_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._get_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _get_func(
-_val_type _val
+char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

Two additional by-hand changes are included for places where the above
Coccinelle script didn't notice them:

	drivers/platform/x86/thinkpad_acpi.c
	fs/lockd/svc.c

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jessica Yu &lt;jeyu@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: phram: fix asm/io.h include usage</title>
<updated>2014-10-22T08:59:30Z</updated>
<author>
<name>Rob Ward</name>
</author>
<published>2014-10-21T19:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b85b8d92c1d720a5b2229aa1bad9bd77f09b8ec5'/>
<id>urn:sha1:b85b8d92c1d720a5b2229aa1bad9bd77f09b8ec5</id>
<content type='text'>
Modify phram to include &lt;linux/io.h&gt; rather than &lt;asm/io.h&gt;

Signed-off-by: Rob Ward &lt;robert.ward114@googlemail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd: phram: Fix whitespace issues</title>
<updated>2014-07-14T17:20:19Z</updated>
<author>
<name>Rob Ward</name>
</author>
<published>2014-07-13T19:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c95777a4bb5daca9857157cc18cb7b8d470364aa'/>
<id>urn:sha1:c95777a4bb5daca9857157cc18cb7b8d470364aa</id>
<content type='text'>
Fix various whitespace issues.

No functional changes.

Signed-off-by: Rob Ward &lt;robert.ward114@googlemail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd: phram: replace kmalloc/strcpy by kstrdup</title>
<updated>2014-07-05T22:40:38Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-05-28T20:31:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89384f646287437ba18afb28ccb125d5866a7209'/>
<id>urn:sha1:89384f646287437ba18afb28ccb125d5866a7209</id>
<content type='text'>
Cc: Joern Engel &lt;joern@lazybastard.org&gt;
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd: phram: Repair multiple instances support</title>
<updated>2014-03-11T05:42:21Z</updated>
<author>
<name>Alexander Sverdlin</name>
</author>
<published>2013-10-14T16:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f6b9feece0066695d87ed6df5bc0d8080c0c96c'/>
<id>urn:sha1:6f6b9feece0066695d87ed6df5bc0d8080c0c96c</id>
<content type='text'>
Commit b2a2a84d35e0f42ad26e326ec4258f6a8b8eecbe (mtd: phram: dot not crash when
built-in and passing boot param) claims to be "based on Ville Herva's similar
patch to block2mtd" (c4e7fb313771ac03dfdca26d30e8b721731c562b), but it has
missed the crucial point of the original path: all these "if(n)def MODULE".
It has broken the possibility to create several phram instances when phram is
compiled as module. The possibility to add instances via /sys writes to
/sys/module/phram/parameters/phram was also broken with mentioned patch.
Proposed patch takes the idea of original block2mtd patch to its full extent.
Assumption "This function is always called before 'init_phram()'" was also
incorrect, so removed the comment. This patch effectively reverts also
b11ec57fc6e6d4882ef01a0c09a1dde58f50492e (mtd: phram: fix section mismatch for
phram_setup).

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@nsn.com&gt;
[Brian: remove static assigment = 0]
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
</feed>
