]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fpga: Replace char * with const char * for filename
authorTien Fong Chee <tien.fong.chee@intel.com>
Fri, 15 Feb 2019 07:57:07 +0000 (15:57 +0800)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 16 Apr 2019 09:51:33 +0000 (11:51 +0200)
Ensure the string for filename is always constant, otherwise it can be
corrupted by the writing.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/fpga/zynqpl.c
include/fpga.h

index 499310d0c0beff69ad024c78d0974dffc9cc3b85..683cf14b47e65ba0201944944691a2a67d00fa72 100644 (file)
@@ -421,7 +421,8 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
        loff_t blocksize, actread;
        loff_t pos = 0;
        int fstype;
-       char *interface, *dev_part, *filename;
+       char *interface, *dev_part;
+       const char *filename;
 
        blocksize = fsinfo->blocksize;
        interface = fsinfo->interface;
index 195f0bdd57a98b1c3404b7d33b31bc53f986969a..51de5c55f830e86f1fc30d2271b9100de058e600 100644 (file)
@@ -41,7 +41,7 @@ typedef struct {                /* typedef fpga_desc */
        unsigned int blocksize;
        char *interface;
        char *dev_part;
-       char *filename;
+       const char *filename;
        int fstype;
 } fpga_fs_info;