Patch "clk/ti/adpll: allocate room for terminating null" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    clk/ti/adpll: allocate room for terminating null

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clk-ti-adpll-allocate-room-for-terminating-null.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c15f3f152075ad7c10b884d212604763c5edc6aa
Author: Stephen Kitt <steve@xxxxxxx>
Date:   Sat Oct 19 16:06:34 2019 +0200

    clk/ti/adpll: allocate room for terminating null
    
    [ Upstream commit 7f6ac72946b88b89ee44c1c527aa8591ac5ffcbe ]
    
    The buffer allocated in ti_adpll_clk_get_name doesn't account for the
    terminating null. This patch switches to devm_kasprintf to avoid
    overflowing.
    
    Signed-off-by: Stephen Kitt <steve@xxxxxxx>
    Link: https://lkml.kernel.org/r/20191019140634.15596-1-steve@xxxxxxx
    Acked-by: Tony Lindgren <tony@xxxxxxxxxxx>
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c
index 255cafb18336a..9345eaf00938e 100644
--- a/drivers/clk/ti/adpll.c
+++ b/drivers/clk/ti/adpll.c
@@ -193,15 +193,8 @@ static const char *ti_adpll_clk_get_name(struct ti_adpll_data *d,
 		if (err)
 			return NULL;
 	} else {
-		const char *base_name = "adpll";
-		char *buf;
-
-		buf = devm_kzalloc(d->dev, 8 + 1 + strlen(base_name) + 1 +
-				    strlen(postfix), GFP_KERNEL);
-		if (!buf)
-			return NULL;
-		sprintf(buf, "%08lx.%s.%s", d->pa, base_name, postfix);
-		name = buf;
+		name = devm_kasprintf(d->dev, GFP_KERNEL, "%08lx.adpll.%s",
+				      d->pa, postfix);
 	}
 
 	return name;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux