mirror of
https://github.com/torvalds/linux.git
synced 2024-12-01 00:21:32 +00:00
ionic: return -EFAULT if copy_to_user() fails
The copy_to_user() function returns the number of bytes that it wasn't
able to copy. We want to return -EFAULT to the user.
Fixes: fee6efce56
("ionic: add hw timestamp support files")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
23ba511722
commit
5871d0c6b8
@ -225,7 +225,9 @@ int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr)
|
||||
memcpy(&config, &lif->phc->ts_config, sizeof(config));
|
||||
mutex_unlock(&lif->phc->config_lock);
|
||||
|
||||
return copy_to_user(ifr->ifr_data, &config, sizeof(config));
|
||||
if (copy_to_user(ifr->ifr_data, &config, sizeof(config)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u64 ionic_hwstamp_read(struct ionic *ionic,
|
||||
|
Loading…
Reference in New Issue
Block a user