diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-08 08:35:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-25 16:20:26 -0200 |
commit | b0f9bf369f34791cf8271be8c610a1e50ead6002 (patch) | |
tree | e1f36f99a442a133b09a181d2a8e13d3afdaa6fa /drivers/media/dvb-frontends/stv0900_core.c | |
parent | 8163ec0b2648c2f7e84edb969dde537ec45f1666 (diff) | |
download | linux-stable-b0f9bf369f34791cf8271be8c610a1e50ead6002.tar.gz linux-stable-b0f9bf369f34791cf8271be8c610a1e50ead6002.tar.bz2 linux-stable-b0f9bf369f34791cf8271be8c610a1e50ead6002.zip |
[media] dvb-frontends: fix potential NULL pointer dereference in stv0900_set_mclk()
The dereference should be moved below the NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stv0900_core.c')
-rw-r--r-- | drivers/media/dvb-frontends/stv0900_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c index 262dfa503c2a..b551ca350e00 100644 --- a/drivers/media/dvb-frontends/stv0900_core.c +++ b/drivers/media/dvb-frontends/stv0900_core.c @@ -300,15 +300,15 @@ static enum fe_stv0900_error stv0900_set_mclk(struct stv0900_internal *intp, u32 { u32 m_div, clk_sel; - dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk, - intp->quartz); - if (intp == NULL) return STV0900_INVALID_HANDLE; if (intp->errs) return STV0900_I2C_ERROR; + dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk, + intp->quartz); + clk_sel = ((stv0900_get_bits(intp, F0900_SELX1RATIO) == 1) ? 4 : 6); m_div = ((clk_sel * mclk) / intp->quartz) - 1; stv0900_write_bits(intp, F0900_M_DIV, m_div); |