[PATCH 4.14 243/343] perf/ioctl: Add check for the sample_period value