Commit 3f6f6343 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

usb: mtu3: fix memory corruption in mtu3_debugfs_regset()

This code is using the wrong sizeof() so it does not allocate enough
memory.  It allocates 32 bytes but 72 are required.  That will lead to
memory corruption.

Fixes: ae078092 ("usb: mtu3: add debugfs interface files")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X8ikqc4Mo2/0G72j@mwanda
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e90cfa81
...@@ -127,7 +127,7 @@ static void mtu3_debugfs_regset(struct mtu3 *mtu, void __iomem *base, ...@@ -127,7 +127,7 @@ static void mtu3_debugfs_regset(struct mtu3 *mtu, void __iomem *base,
struct debugfs_regset32 *regset; struct debugfs_regset32 *regset;
struct mtu3_regset *mregs; struct mtu3_regset *mregs;
mregs = devm_kzalloc(mtu->dev, sizeof(*regset), GFP_KERNEL); mregs = devm_kzalloc(mtu->dev, sizeof(*mregs), GFP_KERNEL);
if (!mregs) if (!mregs)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment