lib: fix attribute read-attr violation