* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
- * $Id: device.c 2730 2005-06-28 16:43:03Z sean.hefty $
+ * $Id$
*/
#include "hca_driver.h"
continue;
if (i < 0 || i >= PAGE_SIZE * 8)
continue;
- snprintf(buf, sizeof buf, name, i);
+ 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);
- snprintf(buf, sizeof buf, name, i);
+ if (RtlStringCbPrintfA(buf, sizeof buf, name, i))
+ return -EINVAL;
+
if (__ib_device_get_by_name(buf))
return -ENFILE;
* ib_query_pkey_chunk() fetches the specified P_Key table entries chunk.
*/
int ib_query_pkey_chunk(struct ib_device *device,
- u8 port_num, u16 index, u16 pkey[32])
+ u8 port_num, u16 index, __be16 pkey[32])
{
return device->query_pkey_chunk(device, port_num, index, pkey);
}