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:
Daniel Verkamp 2016-01-06 10:46:59 -07:00
parent b96536e74a
commit 0c703940a5

View File

@ -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;
}