- snprintf(buf, sizeof(buf)-1, name, i);
- buf[sizeof(buf)-1] = '\0';
+ if (RtlStringCbPrintfA(buf, sizeof buf, name, i))
+ return -EINVAL;
+
if (!strncmp(buf, device->name, IB_DEVICE_NAME_MAX))
set_bit(i, inuse);
}
i = find_first_zero_bit((const unsigned long *)inuse, PAGE_SIZE * 8);
free_page(inuse);
if (!strncmp(buf, device->name, IB_DEVICE_NAME_MAX))
set_bit(i, inuse);
}
i = find_first_zero_bit((const unsigned long *)inuse, PAGE_SIZE * 8);
free_page(inuse);
- snprintf(buf, sizeof(buf)-1, name, i);
- buf[sizeof(buf)-1] = '\0';
+ if (RtlStringCbPrintfA(buf, sizeof buf, name, i))
+ return -EINVAL;
+
* ib_query_pkey_chunk() fetches the specified P_Key table entries chunk.
*/
int ib_query_pkey_chunk(struct ib_device *device,
* ib_query_pkey_chunk() fetches the specified P_Key table entries chunk.
*/
int ib_query_pkey_chunk(struct ib_device *device,
{
return device->query_pkey_chunk(device, port_num, index, pkey);
}
{
return device->query_pkey_chunk(device, port_num, index, pkey);
}