On Thu, Jun 22, 2023 at 8:26 AM Simon Horman <simon.horman@xxxxxxxxxxxx> wrote: > > On Wed, Jun 21, 2023 at 10:02:36AM -0700, Stanislav Fomichev wrote: > > ... > > > @@ -1137,6 +1145,27 @@ static int xsk_setsockopt(struct socket *sock, int level, int optname, > > mutex_unlock(&xs->mutex); > > return err; > > } > > + case XDP_TX_METADATA_LEN: > > + { > > + int val; > > + > > + if (optlen < sizeof(val)) > > + return -EINVAL; > > + if (copy_from_sockptr(&val, optval, sizeof(val))) > > + return -EFAULT; > > + > > + if (val >= 256) > > + return -EINVAL; > > + > > + mutex_lock(&xs->mutex); > > + if (xs->state != XSK_READY) { > > + mutex_unlock(&xs->mutex); > > + return -EBUSY; > > + } > > + xs->tx_metadata_len = val; > > + mutex_unlock(&xs->mutex); > > + return err; > > Hi Stan, > > clang-16 complains that err is used uninitialised here. Oh, thanks, will do 'return 0' instead!