[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 10 Oct 2022 17:28:22 +0800
From: kernel test robot <lkp@...el.com>
To: Kees Cook <keescook@...omium.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: drivers/media/dvb-frontends/cxd2841er.c:3376:12: warning: stack
frame size (9592) exceeds limit (8192) in 'cxd2841er_set_frontend_tc'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 493ffd6605b2d3d4dc7008ab927dba319f36671f
commit: fa35198f39571bbdae53c5b321020021eaad6bd2 fortify: Explicitly check bounds are compile-time constants
date: 2 weeks ago
config: x86_64-randconfig-r006-20221010
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fa35198f39571bbdae53c5b321020021eaad6bd2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout fa35198f39571bbdae53c5b321020021eaad6bd2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/media/dvb-frontends/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/media/dvb-frontends/cxd2841er.c:3376:12: warning: stack frame size (9592) exceeds limit (8192) in 'cxd2841er_set_frontend_tc' [-Wframe-larger-than]
static int cxd2841er_set_frontend_tc(struct dvb_frontend *fe)
^
1 warning generated.
vim +/cxd2841er_set_frontend_tc +3376 drivers/media/dvb-frontends/cxd2841er.c
a6dc60ff1209df Kozlov Sergey 2015-07-28 3375
a6dc60ff1209df Kozlov Sergey 2015-07-28 @3376 static int cxd2841er_set_frontend_tc(struct dvb_frontend *fe)
a6dc60ff1209df Kozlov Sergey 2015-07-28 3377 {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3378 int ret = 0, timeout;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3379 enum fe_status status;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3380 struct cxd2841er_priv *priv = fe->demodulator_priv;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3381 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3382
3f3b48a0c6caba Abylay Ospan 2016-05-14 3383 dev_dbg(&priv->i2c->dev, "%s() delivery_system=%d bandwidth_hz=%d\n",
3f3b48a0c6caba Abylay Ospan 2016-05-14 3384 __func__, p->delivery_system, p->bandwidth_hz);
763f857e40f371 Daniel Scheller 2017-04-09 3385
763f857e40f371 Daniel Scheller 2017-04-09 3386 if (priv->flags & CXD2841ER_EARLY_TUNE)
763f857e40f371 Daniel Scheller 2017-04-09 3387 cxd2841er_tuner_set(fe);
763f857e40f371 Daniel Scheller 2017-04-09 3388
bd2355b8efc684 Daniel Scheller 2017-07-11 3389 /* deconfigure/put demod to sleep on delsys switch if active */
bd2355b8efc684 Daniel Scheller 2017-07-11 3390 if (priv->state == STATE_ACTIVE_TC &&
bd2355b8efc684 Daniel Scheller 2017-07-11 3391 priv->system != p->delivery_system) {
bd2355b8efc684 Daniel Scheller 2017-07-11 3392 dev_dbg(&priv->i2c->dev, "%s(): old_delsys=%d, new_delsys=%d -> sleep\n",
bd2355b8efc684 Daniel Scheller 2017-07-11 3393 __func__, priv->system, p->delivery_system);
bd2355b8efc684 Daniel Scheller 2017-07-11 3394 cxd2841er_sleep_tc(fe);
bd2355b8efc684 Daniel Scheller 2017-07-11 3395 }
bd2355b8efc684 Daniel Scheller 2017-07-11 3396
a6dc60ff1209df Kozlov Sergey 2015-07-28 3397 if (p->delivery_system == SYS_DVBT) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3398 priv->system = SYS_DVBT;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3399 switch (priv->state) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3400 case STATE_SLEEP_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3401 ret = cxd2841er_sleep_tc_to_active_t(
a6dc60ff1209df Kozlov Sergey 2015-07-28 3402 priv, p->bandwidth_hz);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3403 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3404 case STATE_ACTIVE_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3405 ret = cxd2841er_retune_active(priv, p);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3406 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3407 default:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3408 dev_dbg(&priv->i2c->dev, "%s(): invalid state %d\n",
a6dc60ff1209df Kozlov Sergey 2015-07-28 3409 __func__, priv->state);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3410 ret = -EINVAL;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3411 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3412 } else if (p->delivery_system == SYS_DVBT2) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3413 priv->system = SYS_DVBT2;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3414 cxd2841er_dvbt2_set_plp_config(priv,
a6dc60ff1209df Kozlov Sergey 2015-07-28 3415 (int)(p->stream_id > 255), p->stream_id);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3416 cxd2841er_dvbt2_set_profile(priv, DVBT2_PROFILE_BASE);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3417 switch (priv->state) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3418 case STATE_SLEEP_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3419 ret = cxd2841er_sleep_tc_to_active_t2(priv,
a6dc60ff1209df Kozlov Sergey 2015-07-28 3420 p->bandwidth_hz);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3421 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3422 case STATE_ACTIVE_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3423 ret = cxd2841er_retune_active(priv, p);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3424 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3425 default:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3426 dev_dbg(&priv->i2c->dev, "%s(): invalid state %d\n",
a6dc60ff1209df Kozlov Sergey 2015-07-28 3427 __func__, priv->state);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3428 ret = -EINVAL;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3429 }
83808c23e51a61 Abylay Ospan 2016-03-22 3430 } else if (p->delivery_system == SYS_ISDBT) {
83808c23e51a61 Abylay Ospan 2016-03-22 3431 priv->system = SYS_ISDBT;
83808c23e51a61 Abylay Ospan 2016-03-22 3432 switch (priv->state) {
83808c23e51a61 Abylay Ospan 2016-03-22 3433 case STATE_SLEEP_TC:
83808c23e51a61 Abylay Ospan 2016-03-22 3434 ret = cxd2841er_sleep_tc_to_active_i(
83808c23e51a61 Abylay Ospan 2016-03-22 3435 priv, p->bandwidth_hz);
83808c23e51a61 Abylay Ospan 2016-03-22 3436 break;
83808c23e51a61 Abylay Ospan 2016-03-22 3437 case STATE_ACTIVE_TC:
83808c23e51a61 Abylay Ospan 2016-03-22 3438 ret = cxd2841er_retune_active(priv, p);
83808c23e51a61 Abylay Ospan 2016-03-22 3439 break;
83808c23e51a61 Abylay Ospan 2016-03-22 3440 default:
83808c23e51a61 Abylay Ospan 2016-03-22 3441 dev_dbg(&priv->i2c->dev, "%s(): invalid state %d\n",
83808c23e51a61 Abylay Ospan 2016-03-22 3442 __func__, priv->state);
83808c23e51a61 Abylay Ospan 2016-03-22 3443 ret = -EINVAL;
83808c23e51a61 Abylay Ospan 2016-03-22 3444 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3445 } else if (p->delivery_system == SYS_DVBC_ANNEX_A ||
a6dc60ff1209df Kozlov Sergey 2015-07-28 3446 p->delivery_system == SYS_DVBC_ANNEX_C) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3447 priv->system = SYS_DVBC_ANNEX_A;
3f3b48a0c6caba Abylay Ospan 2016-05-14 3448 /* correct bandwidth */
3f3b48a0c6caba Abylay Ospan 2016-05-14 3449 if (p->bandwidth_hz != 6000000 &&
3f3b48a0c6caba Abylay Ospan 2016-05-14 3450 p->bandwidth_hz != 7000000 &&
3f3b48a0c6caba Abylay Ospan 2016-05-14 3451 p->bandwidth_hz != 8000000) {
3f3b48a0c6caba Abylay Ospan 2016-05-14 3452 p->bandwidth_hz = 8000000;
3f3b48a0c6caba Abylay Ospan 2016-05-14 3453 dev_dbg(&priv->i2c->dev, "%s(): forcing bandwidth to %d\n",
3f3b48a0c6caba Abylay Ospan 2016-05-14 3454 __func__, p->bandwidth_hz);
3f3b48a0c6caba Abylay Ospan 2016-05-14 3455 }
3f3b48a0c6caba Abylay Ospan 2016-05-14 3456
a6dc60ff1209df Kozlov Sergey 2015-07-28 3457 switch (priv->state) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3458 case STATE_SLEEP_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3459 ret = cxd2841er_sleep_tc_to_active_c(
a6dc60ff1209df Kozlov Sergey 2015-07-28 3460 priv, p->bandwidth_hz);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3461 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3462 case STATE_ACTIVE_TC:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3463 ret = cxd2841er_retune_active(priv, p);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3464 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3465 default:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3466 dev_dbg(&priv->i2c->dev, "%s(): invalid state %d\n",
a6dc60ff1209df Kozlov Sergey 2015-07-28 3467 __func__, priv->state);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3468 ret = -EINVAL;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3469 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3470 } else {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3471 dev_dbg(&priv->i2c->dev,
a6dc60ff1209df Kozlov Sergey 2015-07-28 3472 "%s(): invalid delivery system %d\n",
a6dc60ff1209df Kozlov Sergey 2015-07-28 3473 __func__, p->delivery_system);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3474 ret = -EINVAL;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3475 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3476 if (ret)
a6dc60ff1209df Kozlov Sergey 2015-07-28 3477 goto done;
c7518d13f70e62 Daniel Scheller 2017-04-09 3478
763f857e40f371 Daniel Scheller 2017-04-09 3479 if (!(priv->flags & CXD2841ER_EARLY_TUNE))
c7518d13f70e62 Daniel Scheller 2017-04-09 3480 cxd2841er_tuner_set(fe);
c7518d13f70e62 Daniel Scheller 2017-04-09 3481
a6dc60ff1209df Kozlov Sergey 2015-07-28 3482 cxd2841er_tune_done(priv);
e3943aa6d8023b Daniel Scheller 2017-04-09 3483
e3943aa6d8023b Daniel Scheller 2017-04-09 3484 if (priv->flags & CXD2841ER_NO_WAIT_LOCK)
e3943aa6d8023b Daniel Scheller 2017-04-09 3485 goto done;
e3943aa6d8023b Daniel Scheller 2017-04-09 3486
a6dc60ff1209df Kozlov Sergey 2015-07-28 3487 timeout = 2500;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3488 while (timeout > 0) {
a6dc60ff1209df Kozlov Sergey 2015-07-28 3489 ret = cxd2841er_read_status_tc(fe, &status);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3490 if (ret)
a6dc60ff1209df Kozlov Sergey 2015-07-28 3491 goto done;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3492 if (status & FE_HAS_LOCK)
a6dc60ff1209df Kozlov Sergey 2015-07-28 3493 break;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3494 msleep(20);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3495 timeout -= 20;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3496 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3497 if (timeout < 0)
a6dc60ff1209df Kozlov Sergey 2015-07-28 3498 dev_dbg(&priv->i2c->dev,
a6dc60ff1209df Kozlov Sergey 2015-07-28 3499 "%s(): LOCK wait timeout\n", __func__);
a6dc60ff1209df Kozlov Sergey 2015-07-28 3500 done:
a6dc60ff1209df Kozlov Sergey 2015-07-28 3501 return ret;
a6dc60ff1209df Kozlov Sergey 2015-07-28 3502 }
a6dc60ff1209df Kozlov Sergey 2015-07-28 3503
:::::: The code at line 3376 was first introduced by commit
:::::: a6dc60ff1209df29ee4668024e93d31f31421932 [media] cxd2841er: Sony CXD2841ER DVB-S/S2/T/T2/C demodulator driver
:::::: TO: Kozlov Sergey <serjk@...up.ru>
:::::: CC: Mauro Carvalho Chehab <mchehab@....samsung.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (129876 bytes)
Powered by blists - more mailing lists