Skip to content

Commit

Permalink
drm/msm/dpu: removed logically dead code
Browse files Browse the repository at this point in the history
Fixed coverity warning by removing the dead code

Addresses-Coverity: 1494147 ("Logically dead code")

Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20211203193253.108813-1-amhamza.mgc@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
  • Loading branch information
Ameer Hamza authored and Rob Clark committed Dec 7, 2021
1 parent 53d2279 commit 542a5db
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,17 +698,17 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
{
struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_irq *irq;
int i, ret = 0;
int i;

if (!p) {
ret = -EINVAL;
goto fail;
DPU_ERROR("failed to create encoder due to invalid parameter\n");
return ERR_PTR(-EINVAL);
}

phys_enc = kzalloc(sizeof(*phys_enc), GFP_KERNEL);
if (!phys_enc) {
ret = -ENOMEM;
goto fail;
DPU_ERROR("failed to create encoder due to memory allocation error\n");
return ERR_PTR(-ENOMEM);
}

phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
Expand Down Expand Up @@ -748,11 +748,4 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
DPU_DEBUG_VIDENC(phys_enc, "created intf idx:%d\n", p->intf_idx);

return phys_enc;

fail:
DPU_ERROR("failed to create encoder\n");
if (phys_enc)
dpu_encoder_phys_vid_destroy(phys_enc);

return ERR_PTR(ret);
}

0 comments on commit 542a5db

Please sign in to comment.