Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7de6352d authored by Aniket Kumar Lata's avatar Aniket Kumar Lata
Browse files

hal: Fix potential NULL dereference

Fix potential NULL dereference of active input stream.

Change-Id: I65287fe928d1a357f0bba9696af008bd2eaec870
parent 637e2d4f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -919,6 +919,11 @@ static int send_effect_enable_disable_mixer_ctl(struct audio_device *adev,
    long set_values[6];
    struct stream_in *in = adev_get_active_input(adev);

    if (in == NULL) {
        ALOGE("%s: active input stream is NULL", __func__);
        return -EINVAL;
    }

    ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
    if (!ctl) {
        ALOGE("%s: Could not get mixer ctl - %s",
@@ -947,6 +952,11 @@ static int update_effect_param_ecns(struct audio_device *adev, unsigned int modu
    struct audio_usecase *usecase = NULL;
    struct stream_in *in = adev_get_active_input(adev);

    if (in == NULL) {
        ALOGE("%s: active input stream is NULL", __func__);
        return -EINVAL;
    }

    usecase = get_usecase_from_list(adev, in->usecase);
    if (!usecase)
        return -EINVAL;