Patch "ata: libata-eh: Fix compilation warning in ata_eh_link_report()" has been added to the 4.19-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

    ata: libata-eh: Fix compilation warning in ata_eh_link_report()

to the 4.19-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:
     ata-libata-eh-fix-compilation-warning-in-ata_eh_link.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 4fc2761182c4e880684534e1c3cd1f029a54cca1
Author: Damien Le Moal <dlemoal@xxxxxxxxxx>
Date:   Tue Sep 12 09:08:40 2023 +0900

    ata: libata-eh: Fix compilation warning in ata_eh_link_report()
    
    [ Upstream commit 49728bdc702391902a473b9393f1620eea32acb0 ]
    
    The 6 bytes length of the tries_buf string in ata_eh_link_report() is
    too short and results in a gcc compilation warning with W-!:
    
    drivers/ata/libata-eh.c: In function ‘ata_eh_link_report’:
    drivers/ata/libata-eh.c:2371:59: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 4 [-Wformat-truncation=]
     2371 |                 snprintf(tries_buf, sizeof(tries_buf), " t%d",
          |                                                           ^~
    drivers/ata/libata-eh.c:2371:56: note: directive argument in the range [-2147483648, 4]
     2371 |                 snprintf(tries_buf, sizeof(tries_buf), " t%d",
          |                                                        ^~~~~~
    drivers/ata/libata-eh.c:2371:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 6
     2371 |                 snprintf(tries_buf, sizeof(tries_buf), " t%d",
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     2372 |                          ap->eh_tries);
          |                          ~~~~~~~~~~~~~
    
    Avoid this warning by increasing the string size to 16B.
    
    Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
    Reviewed-by: Hannes Reinecke <hare@xxxxxxx>
    Tested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
    Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 73a4dd37d04ae..63423d9e1457c 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2443,7 +2443,7 @@ static void ata_eh_link_report(struct ata_link *link)
 	struct ata_eh_context *ehc = &link->eh_context;
 	struct ata_queued_cmd *qc;
 	const char *frozen, *desc;
-	char tries_buf[6] = "";
+	char tries_buf[16] = "";
 	int tag, nr_failed = 0;
 
 	if (ehc->i.flags & ATA_EHI_QUIET)



[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