ioat: allocate channel context with calloc()
This ensures that any uninitialized fields are 0/NULL so if ioat_channel_start() fails, ioat_channel_destruct() will not try to free bogus pointers. Change-Id: I99278c9fa280cbcdf3f7448e77db3ac98b59cdd6 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
b96536e74a
commit
0c703940a5
@ -498,7 +498,7 @@ ioat_attach(void *device)
|
||||
struct ioat_channel *ioat;
|
||||
uint32_t cmd_reg;
|
||||
|
||||
ioat = malloc(sizeof(struct ioat_channel));
|
||||
ioat = calloc(1, sizeof(struct ioat_channel));
|
||||
if (ioat == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user