Skip to content

Commit

Permalink
ath9k: cleanup a min_t() cast
Browse files Browse the repository at this point in the history
If the firmware was over 2G, it would cause memory corruption and the
system would die here.  Obviously we all know the firmware isn't going
to be that large but static checkers get upset.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Feb 6, 2012
1 parent 910570b commit 291689f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/hif_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
return -ENOMEM;

while (len) {
transfer = min_t(int, len, 4096);
transfer = min_t(size_t, len, 4096);
memcpy(buf, data, transfer);

err = usb_control_msg(hif_dev->udev,
Expand Down

0 comments on commit 291689f

Please sign in to comment.