mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-28 05:34:06 +03:00 
			
		
		
		
	jhd1313m1: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
		| @@ -43,6 +43,8 @@ jhd1313m1_context jhd1313m1_init(int bus, int lcd_addr, int rgb_addr) | |||||||
|     if (!dev) |     if (!dev) | ||||||
|         return NULL; |         return NULL; | ||||||
|  |  | ||||||
|  |     memset((void *)dev, 0, sizeof(struct _jhd1313m1_context)); | ||||||
|  |  | ||||||
|     // make sure MRAA is initialized |     // make sure MRAA is initialized | ||||||
|     int mraa_rv; |     int mraa_rv; | ||||||
|     if ((mraa_rv = mraa_init()) != MRAA_SUCCESS) |     if ((mraa_rv = mraa_init()) != MRAA_SUCCESS) | ||||||
| @@ -52,8 +54,6 @@ jhd1313m1_context jhd1313m1_init(int bus, int lcd_addr, int rgb_addr) | |||||||
|         return NULL; |         return NULL; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     memset((void *)dev, 0, sizeof(struct _jhd1313m1_context)); |  | ||||||
|  |  | ||||||
|     // initialize the MRAA contexts |     // initialize the MRAA contexts | ||||||
|  |  | ||||||
|     if (!(dev->i2cLCD = mraa_i2c_init(bus))) |     if (!(dev->i2cLCD = mraa_i2c_init(bus))) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jon Trulson
					Jon Trulson