diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2020-04-16 09:45:07 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-05 13:12:30 +0200 |
commit | 839efdb65ffd8f2b1055e60d26d703f832a38c54 (patch) | |
tree | a1fc51fc49fc140ff612e5d16e3f774b7270f00b /drivers/staging/media/ipu3 | |
parent | 8c038effd893920facedf18c2c0976cec4a33408 (diff) | |
download | linux-839efdb65ffd8f2b1055e60d26d703f832a38c54.tar.gz linux-839efdb65ffd8f2b1055e60d26d703f832a38c54.tar.bz2 linux-839efdb65ffd8f2b1055e60d26d703f832a38c54.zip |
media: staging: ipu3-imgu: Add a sanity check for the parameter struct size
There have been cases where seemingly innocuous patches have broken the
uAPI by changing the memory layout of the parameter struct. Generally such
changes also introduce a change in the size of the entire struct. This
patch adds a sanity check to avoid such cases happening in the future.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Tested-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/ipu3')
-rw-r--r-- | drivers/staging/media/ipu3/ipu3-css.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c index 4f04fe838b0c..3c700ae9c94e 100644 --- a/drivers/staging/media/ipu3/ipu3-css.c +++ b/drivers/staging/media/ipu3/ipu3-css.c @@ -1911,6 +1911,13 @@ int imgu_css_meta_fmt_set(struct v4l2_meta_format *fmt) switch (fmt->dataformat) { case V4L2_META_FMT_IPU3_PARAMS: fmt->buffersize = sizeof(struct ipu3_uapi_params); + + /* + * Sanity check for the parameter struct size. This must + * not change! + */ + BUILD_BUG_ON(sizeof(struct ipu3_uapi_params) != 39328); + break; case V4L2_META_FMT_IPU3_STAT_3A: fmt->buffersize = sizeof(struct ipu3_uapi_stats_3a); |