1 /* Reduced from -Wanalyzer-exposure-through-uninit-copy false positives
2 seen in Linux kernel in drivers/net/ethernet/intel/ice/ice_ptp.c */
4 /* { dg-do compile } */
5 /* { dg-options "-fanalyzer" } */
6 /* { dg-require-effective-target analyzer } */
9 copy_from_user(void* to
, const void* from
, unsigned long n
);
12 copy_to_user(void* to
, const void* from
, unsigned long n
);
22 struct hwtstamp_config
32 struct hwtstamp_config tstamp_config
;
40 ice_ptp_set_ts_config(struct ice_pf
* pf
, struct ifreq
* ifr
)
42 struct hwtstamp_config config
;
44 if (copy_from_user(&config
, ifr
->ifr_ifru
.ifru_data
, sizeof(config
)))
46 pf
->ptp
.tstamp_config
.tx_type
= 0;
47 pf
->ptp
.tstamp_config
.rx_filter
= 0;
48 config
= pf
->ptp
.tstamp_config
;
49 if (copy_to_user(ifr
->ifr_ifru
.ifru_data
, &config
, sizeof(config
))) /* { dg-bogus "-Wanalyzer-exposure-through-uninit-copy" "PR analyzer/112969" } */