This patch includes the fixes for CID 187514, CID187540 and 187531.
Change-Id: I225fa93071e0e57f1e58825961d74cd6b315578e
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
__raw_writel(reg, smfc->reg + REG_MAIN_JPEG_CNTL);
val = __raw_readl(smfc->reg + REG_MAIN_INT_STATUS);
- if (smfc_is_capable(ctx->smfc, V4L2_CAP_EXYNOS_JPEG_B2B_COMPRESSION))
+ if (smfc_is_capable(smfc, V4L2_CAP_EXYNOS_JPEG_B2B_COMPRESSION))
val2 = __raw_readl(smfc->reg + REG_SEC_INT_STATUS);
if (!val && !val2) {
return false;
}
- if (!!(ctx->flags & SMFC_CTX_B2B_COMPRESS) && !val2) {
+ if (ctx && !!(ctx->flags & SMFC_CTX_B2B_COMPRESS) && !val2) {
dev_err(smfc->dev, "Secondary image is not completed\n");
return false;
}
static bool smfc_alloc_tables(struct smfc_ctx *ctx)
{
+ int i;
+
if (!ctx->quantizer_tables) {
ctx->quantizer_tables = kmalloc(
sizeof(*ctx->quantizer_tables), GFP_KERNEL);
return false;
}
memset(ctx->quantizer_tables, 0, sizeof(*ctx->quantizer_tables));
- ctx->quantizer_tables->compsel[0] = INVALID_QTBLIDX;
- ctx->quantizer_tables->compsel[1] = INVALID_QTBLIDX;
- ctx->quantizer_tables->compsel[2] = INVALID_QTBLIDX;
- ctx->quantizer_tables->compsel[3] = INVALID_QTBLIDX;
+ for (i = 0; i < SMFC_MAX_QTBL_COUNT; i++)
+ ctx->quantizer_tables->compsel[i] = INVALID_QTBLIDX;
if (!ctx->huffman_tables) {
ctx->huffman_tables = kmalloc(
struct smfc_decomp_qtable {
/* quantizers are *NOT* stored in the zig-zag scan order */
u8 table[SMFC_MAX_QTBL_COUNT][SMFC_MCU_SIZE];
- char compsel[SMFC_MAX_NUM_COMP]; /* compsel[0] for component 1 */
+ char compsel[SMFC_MAX_QTBL_COUNT];
};
struct smfc_ctx {